2006 Toyota 4Runner sunroof grinding noise

Why does the Sun Roof make a very bad grinding noise at the end of its travel?

Because the mechanism is worn and trying to grind itself to pieces in the area of travel with the most resistance.