Old house may have brass flange with lead soil pipe. Lead can be bent back out then a new flange put in place and pound the lead back to the flange.
It is possible that the flange is damage due to poor install, and the closet bolts has slipped off its groove. Or, the sub floor underneath the toilet is damaged/rotten.
A new piece of ply wood can be install in place with extra backing for support if needed. Cut the soil pipe off then glue a short length of soil pipe (4" or 3") via an ABS/PVC coupling (make sure that it is above the finish floor), or attach it via a mechanical/rubber coupling. Then glue the new flange in place after cut off the new pipe flush to the floor. Screw down the flange to the floor using 1.5" or longer screws, and make sure that the closet bolt groves are line up and in a position that it will not move off the groves once you attach the toilet to it. Clean the toilet bottom and attach a wax ring then bolt it to the flange/floor (wax ring with funnel is better than plain wax ring, sit on the toilet before bolt down to make sure the surface mate, and line up the toilet to the wall so it is square before bolt down).
Clean the area around the edge of the toilet base and floor, and put a small bead of white 100% silicone around the base then wet your fingers to make a clean bead.
Good luck.