Just had one more (bad) idea. I.e. I don't recommend it. And I haven't tested it.
And also even if it should work for one Target (CPU + OS) then it may not work on another, or need different code.
It may even change between fpc versions, so when you update you must test, and hope it can be made to work again.
As indicated a nested procedure has a hidden parameter. So for it to work to call it via a reference the value of that hidden pointer probably must be stored along with the "machine code pointer". (just like the self param for a method is stored in TMethod).
That would then happen if you declare
type TMyNestedProc = procedure (Sender: TObject) is nested;
var procptr: TMyNestedProc;
In would then guess, that "procptr" has this value....
I don't know the internal format of that variable/type. But if the "hidden parentfp" is in it, then - even if using raw pointer access - it should be possible to extract it.
If you have it, you can store it (temporarily) in the "TMethod.Data" part (which is passed as "self" param).
Then when your proc is called, you would need to restore it. That mean you need a 2nd proc, that does the restoration, that re-builds the variable "procptr", and then calls it.
On Window, x86-64 the parent_fp is in the same pos as "self" would be, and *probably* the same calling convention. So you wouldn't need the wrapper, if you could get it and store it in TMethod.Data.
That is a lot of work. And a lot of danger.
I would certainly not do this myself.