Our plastic flange broke some years ago and I left it in place and added a stainless steel flange ring on top of it. Hasn’t leaked or come loose since. I used the largest flat head screws to attach it the the wood floor and the foam gasket seals through it to the remains of the plastic fitting.
https://www.homedepot.com/p/Oatey-1-...7782/303864005