After doing some digging I found the cause of the incompatibilities:
It's seems to be caused by https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler/blob/b7204aca2fe4b00112f0925951dcf386af136b83/includes/WebVideoTranscode/WebVideoTranscode.php#L575 in MediaWiki 1.37, which is https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler/blob/b7e29cd22e59e9f96329dcd562f78b3c8a507533/includes/WebVideoTranscode/WebVideoTranscode.php#L575 in MediaWiki 1.38+. Because of the way QuickInstantCommons does it, it uses https://github.com/wikimedia/mediawiki-extensions-QuickInstantCommons/blob/f7c141b9bda98dd4d11190f402362c60594a47af/src/Repo.php#L57 (IForeignRepoWithMWApi) even on <1.38, using a stub interface. This results in TimedMediaHandler expecting ForeignAPIFile to load the source, but even in <1.38 gets IForeignRepoWithMWApi, which results in TimedMediaHandler finding no sources, returning an empty array, resulting in the error at https://github.com/wikimedia/mediawiki-extensions-TimedMediaHandler/blob/da0355a0e3d581ad717460e912b88910ee24d074/includes/TimedMediaTransformOutput.php#L361 because the getMediaSources() function returns no found sources with ForeignAPIFile Because QuickInstantCommons uses IForeignRepoWithMWApi as a stub, for forward and backward compatibility simultaneously. But that's not what TimedMediaHandler is expecting.
Downstream task: https://phabricator.miraheze.org/T8984