I've just had this error occur, on Lazarus 4.0 running on ARM macOS.
I had just added a helper class to an 8000+ line unit. I did notice something in this thread about helpers, so I removed the code and put it into a separate unit (as a unit, not as an include), and it has, for the time being at least, got rid of the error.