I'm no plumber but I suspect that it might be on lead and oakum installed from the bottom. That would have been done before the closet bend was leaded into place. You might find it easier to replace the bend and everything back to the bell joint in the horizontal.
Ideally, when all is done your flange should be on top of the finished floor.
Let's wait and see what the real plumbers have to say.