When you run across a broken PVC closet flange, the easiest way to cut it out is to use a 4-inch hole saw. My biggest trick with it is to run the drill in reverse while cutting it out. Running the drill in reverse stops the teeth from cutting in too hard while drilling and catching the flange/pipe. If it catches hard while the drill is spinning fast, it can crack the pipe (or, worse, the fitting below).
This has proven to be the cleanest and easiest way to cut out the top of the flange. Depending on the type of flange installed and the depth of the fitting below, I’ll either use an inside cutter and a boring tool to bore out the pipe or I’ll put in an inside flange.