I'm not sure how much space we are talking about here but can it be filled with vinal cement/concrete. If you get everything ready, pipe cut to proper length and prefit you could pour the cement and install the flange. Be sure there is no cement anywhere where it would cause a problem installing the flange bolts that hold the toilet down. You can stick the flange screws into the wet cement and let it harden around the screw.
If you fill the space and then try drilling it it may just break out and make a mess.
They make a concrete bonder that can be brushed on the existing concrete so it will bond better. Follow directions.