Going back 20 or so years, I had my headliner in the Capri replaced not long after repainting the car.
I tossed up whether to fit it myself or not.
No, pay someone to do it properly.
He fitted the headliner, glueing it around the sunroof opening.
Then cut the excess off using a Stanley knife, straight through the still relatively fresh paint, down to bare metal.
Not very professional in the end.