Cutting out plastic waste fittings and gluing up new fittings is easy, especially if you have ample room to work on the pipes. Even with restricted space, there are tools that allow you to cut the pipe from the inside. One is a Rigid internal waste pipe cutter and another is a circular plastic pipe cut-off saw that is fitted to a mandrel that you can use in an electric hand drill or your Dremel tool.
Your main problem will be setting the new flange at the correct height.
NtP