The testcase in PR51634 needs explicit allocations, as in the final comment.
PR51634 was closed, since the nesting of typebound operators is fixed.
See also the test case in PR 51634.
(Mixed up the test cases. The PR mentioned in comment 1 is the same as in comment 0 - and a good test case. I mixed it up with PR 46262 comment 3, which is a longer example which also requires allocation on assignment.)
I think the realloc issue is fixed by the commit for PR 48351.
The test case in PR51634 now kind of works. (It fails but because it is invalid.)
The big test case at PR 46262 comment 3 also works now :-)