I started looking at that file but there is just too much to look at …
I can say this however, while in the OnCreate Event of the object the only item that is valid is the SELF, in other words, the returning object, the result that is, is not yet valid.
So If you are setting the Call back pointer via a Timer or something on that order with a wild value of an instance the Assign test will pass because it knows no better but it does not mean it's valid..
I can't say if this is what you are doing but this is what you can try and that is at the start up before calling any constructors, not while inside a constructor you should be ensuring any returning instance is set to nil.
If you have instances living outside a class in global space, on the heap, in some array etc, these most likely have wild values in them and they need to be cleared before any of this stuff gets running...
Also while in the app if you unhook them, they should be NILLED out so that the Assign will work properly …
This is just my assumptions because I've seen code like this before in Delphi which is where I've been spending a lot of time lately and I am sure its no different in fpc in this respect.