I don’t think that the thief died before Jesus.
The soldiers came to break the legs of the criminals, which means they were still alive. They did it to force death by suffocation.
But when they got to Jesus, they saw that He was already dead.