Pecco Bagnaia stole a march to take victory while his mentor and racing legend Valentino Rossi completed his last ever Grand Prix lap