There are fairly routine issues (like https://gerrit.wikimedia.org/r/c/mediawiki/core/+/889944) caused by folks running phpunit tests without having run composer update to get their libraries up to date. The failures tend to be very obscure and not obviously related to the root cause (aka outdated libraries).
To prevent folks from losing time on this sort of thing, phpunit.php (or the bootstrap class, see T90875) should perform the same check for an out-of-date composer.json that maintenance/update.php does.