Jbugy check in the storage/logs folder in the Flarum installation. There should be a log file for the package manager, hopefully showing the error that lead to the broken Composer files.
Most likely causes are filesystem permission errors, lack of disk space, or PHP limits like memory exhaustion or execution time out (for those PHP errors, the error will likely in the global system log instead of the Flarum log)
If you are able to restore a backup and then the problem happens again when re-trying, consider restoring again and trying one more with Flarum debug mode enabled, to see more details.