He was just unlucky on that day. Daniil should have claimed the pole-position with a big gap as he had purple first and second sectors but the session was red-flagged when he was exiting the last turn and his time was not counted.
It wasn't the first time: in one of the previous rounds on the Paul Ricard circuit, he had to start from P14 because his flying lap was compromised with the yellow flags. Now he qualified on the 18th position, but his advantage in pace was so huge that he made his way to the podium in both races.
I've seen very many talents, but very few had the qualities of this guy. And his overtaking skills were unrivaled.