That was a major mess up. You might get by with a waxless adapter - Fernco and Fluidmaster make them. I'm not sure if they'll handle that big of a reach, though...you'd have to read their instructions or spec sheets. Under no circumstances would I use wax for this without some other remediation.
What's underneath? Can you access it from below? If so, you could cut out the pipe and flange from below and maybe install a new riser and then put the flange where it is supposed to be.
If you use the Fluidmaster waxless seal, push it onto the bottom of the bowl first.