Fabio Quartararo secures pole position for the Grand Prix but finishes fourth in a dramatic sprint race dominated by Ducati riders.