Why would anyone want to use GARBAGE plastic piping for drainage when Cast Iron is available? Forget code for a minute, how about using either of the following.
1- Get a No Hub Cast Iron Quick set floor flange (they vary in length and dia and can be bought in 2″-6″ depth and are adjustable for the screw ups among us)
2- Go to a decent plumbing supply and buy anH cast Iron CAULKED floor flange. Then borrow a 3″ OR 4″ inside Cast Iron cutter (depending on the size of pipe your cutting) and then all you do is Yarn and calk in a NEW PROPER leak and gas tight fitting without reducing the diameter of your GREAT LONG LASTING CAST IRON SOIL PIPING.
Leave the mixing of materials to the bums who dont know better.