I think you’re talking about the trim that supports garage attic access panel. It doesn’t look like many building inspectors really care about it, that piece of trim is rarely well attached to the ceiling framing and even if it is, it will burn fast causing the garage access panel to drop.
What I would suggest is to either drive a few nails around the frame the drywall sheet fits in so that square piece sits on the nails and the trim remains as a decoration not as an actual support. You could also use screws or L shaped brackets for this purpose. Look at the drawing below: