Actually. I think I have the exact fitting you're looking at on my desk now. The ridges you feel on the inside are threads which makes this an inside 4" pipe cleanout body for a 3" threaded plug. Does it measure 2" to the bottom from the top?
View attachment 79829
I also thought this might be a fitting, but don't fittings typically have a hub or bell to them? The outside of this pipe is smooth. I also thought the four circles were a clue. The rectorseal seems like a good lead, but the "obstruction" doesn't really look like it was ever threaded. BTW, it case it aids in this mystery, perhaps I should have mentioned there is a toilet on the exact opposite side of the wall. Does this indicate that it was/is a fitting since I presume they are sharing the same waste pipe?
Lastly, here's a photo of the back of the old flange. It definitely was a hub flange, which I think describes the fact it fit over the mystery pipe.