If none of those work, then you can always sink a couple deck screws in it to suck it up so it seals. Annoying I know when it comes time to access the attic, but that is what, like 4-6 times a year, maybe.
Might be a bad gas strut. I had to replace mine a few weeks ago because the geniuses that installed the attic access put the sharp end of the mounting screws against the strut. After 3 years the strut casing was fully breached. Afterwards access door wouldn't shut completely like that.
Bought replacement struts (100lb) & install was pretty easy aside from compressing the new strut. Used rachet straps
Does it have insulation/styrofoam panels attached to it or between the panel and the ladder? Mine does and sometimes the foam shifts to the side and keeps it from closing properly.
i have this same issue on a home we moved into, and haven't figured out a solution yet. Everything online says to replace the whole ladder assembly, which is not happening except as a last resort