Damn did I get screwed, my own fault though

I drive new cars every day at work and there are several every day that have sun roof problems that bounce back.

It can be several things but mostly it needs to be taught where to stop.

The windows do the same thing.

On the brand X that I drive to stop the roof just before it closes and slowly bump it to closed and once closed hold the switch to teach it. (Windows same way) then I open and close several times. Sometimes it takes a few time to program, then sometimes I take it to trim to repair.

Good luck and don't beat yourself up too bad.