After erroneously alerting upstream in this thread https://debbugs.gnu.org/81819 I have some more information
Emacs 31 can now load packages during loaddefs generation in order to get more information about macros and such. It recovers nicely from errors during package loading so it turns out that the loaddefs are generated to completion just how we like it despite there being an error reported. This means there is no real bug in this thread other then a spurious printed error and a 2 second delay. It would indeed be nice to fix that though.
