Another member
@jag john has done the same with both a MG HS PHEV and a Jag e pace.
Approached the car from the rear, car detects the key is close and allows the boot / hatch back to be opened without opening the rest of the car.
You open the boot ( to put in your shopping etc ) and you put the keys down on the boot floor carpet.
The car then permits you to close the boot ( keys inside ) and it automatically re-locks the boot only, because the rest of the car is already locked.
Bingo - Your locked out !.
Options - Ring and have the spare brought over, ring the recovery people and hope they can get in, have a spare key blade made and conceal, or always open and close the car fully with the fob.
Oh ........... If you have a model with the ISmart App, you can use that to open the car.
But then your realise the phone is on charge in the car, or in the pocket of your jacket, that is on the back seat !.
Just because it's been one of them days ?

.