Probably handwritten into a blockquote
Basically, there's a correlation. Each wild encounter has a 32bit seed, which generates the EC, PID, IVs, Height & Weight. We can easily derive the EC by reversing the algorithm to get the seed, then we can run it forwards to make sure the seed yields all the resulting features. If it doesn't match, you get the error message.
If you're curious how the logic is translated in PKHeX's code:
https://github.com/kwsch/PKHeX/blob/223b56d779c11019482f8b97cfcf62312342b867/PKHeX.Core/Legality/RNG/Overworld8RNG.cs
It's similar to Gen3/4's PIDIV restrictions, hence the same error message.