It's possible the car locked because of a glitch with Bluetooth on your phone and not because of an issue on the car. When I first got my Model 3, I was using a 2 year old phone (Nexus 6) that caused all sorts of phone key issues. After upgrading to a OnePlus 6T last year, all of the issues went away.