The 41-year-old from Glengormley had qualified in 22nd place on the grid, but was forced out on the seventh lap.
McWilliams made a surprise return to the Grand Prix circuit after a spell recuperating from a shoulder injury.
Valentino Rossi won his ninth race after storming through from fourth place on the grid.