Many have questioned Thanos’ decision to take the risk of giving someone like Loki, who is wayward and prone to trickery, the incredibly valuable Mind Stone and relying on him to secure the Space Stone for him.
Even though Loki failed in securing the Space stone for him and also lost the Mind Stone in the process, his actions destabilized Asgardian and set the Ragnarok prophecy into motion.
But it was the 2012 events in New York that caused Odin and Thor to become too focused on Loki.
He would have seen the attack on Nidavellir coming, allowing the mighty forces of Asgard and Thor to arrive before Thanos did.