How do I get my recessed light fixture flush?
The symptom of the gap you have in all my experience with recess lights have been the rough in housing has room for deflection. As you push the trim in place, the rough in pushes up also under the tension of the lens going in and it stays pushed up until the lens bottoms out on the ceiling and is released. The housing relaxes back down and creates the gap.

I have had some success minimizing the gap by twisting the trim slightly after the trim is meeting the ceiling. Twist it in the direction that keeps the tension fingers out on the lens. The wrong direction may allow the tension fingers to collapse for removal and you are back to square one.

If that does not work to your satisfaction, I have glued the rough in down to the drywall so it is stable enough to not rise when inserting the trim.

Blue tape the finished drywall to keep it clear of the adhesive you choose to use, it can be practically anything. Construction adhesive or painters caulk would be my choice. Push up on the rough in to expose the gap if possible of the upper drywall surface and rough in lip. Inject a lot of the tube in the space, it will be messy, have paper on the floor. Let the rough in back down, more may ooze out, keep it clean remove tape and let dry for a while. A day or two will work, longer the better, then try to reinstall.