You shouldn't need to FreeAndNil() all those components on the form.
The owner is TAppForm itself so they will be destroyed when the form itself is destroyed.
And in fact... the FreeAndNil() is never executed because you check for "is TCustomForm". And you have no TCustomForm's in the Components of that form. Try setting a breakpoint with F5 on line 15 and see that it's never executed.
Also, setting WinXP and Win8 compatibility shouldn't be need either.
Doing so will only complicate your issue because that shouldn't be the cause.
For now, my guess is McAfee. In fact, disabling the virusscanner should have been the first item on your list to try when having explainable issues with an OS.
I changed the above Close method to a code that is posted elsewhere on the forum.
With no incompatibilities set, it raised an exception the same as before. When I set Win8 compatibility, it has not raised any exceptions ... for several attempts with testing. At present I am going to just wait and see.
In fact, this makes my suspicions only bigger.
Because your FormClose-changes actually
do nothing, the only thing that made the difference would be setting that Win8 compatibility. And that could affect the McAfee virusscanner too. But you don't want to do that every time.
So, first try to set everything back to normal (normal compat and normal options in Lazarus) and disable the virusscanner (temporarily).