Oscar Piastri put in a sensational lap to claim Sprint Pole at the Qatar Grand Prix after chaos over track limits saw many drivers' lap times deleted.