I would recommend to use MMX Code Explorer and use this feature from there, because of 2 reasons:
Prototyping does not work properly if any newer language features are in use, like inline variables. There was a debate going on for your problem in the QualityPortal
Since Delphi 13 the "solution" to this problem is, refactoring is missing in general and the new official way is to use MMX Code Explorer.
The shortcode in MMX is Alt+Ctrl+Y
So even if the prototype works under some circumstances in Delphi 12.3 I would recommend to switch to MMX now. It works better than the refectoring in Delphi 12.3 and will be the official solution in Delphi 13.
At this moment better use the beta version because there are some bugfixes.