There was no harm to it. It popped Mas, it distanced Alaphilippe for a bit, and disrupted the group chasing Bernal for a little bit. It was the exact thing Landa did behind Carapaz (and vice versa too, iirc?) at the Giro.
If he had managed to bridge to Bernal before being caught, (yes, unlikely, but worth the ambition) it would have been hailed as genius.