export getMessages :: GHC.Types.Error.Messages -> ...
For some reason that selector was hidden since GHC-8.10.7, so there is no way to get separate MsgEnvelope e messages out of Messages e anymore.
In general, I'd prefer if ghc didn't hide its internals at all, you never know what you need when writing plugins or tools using ghc library.