I had my shed door renewed which had a rim lock which worked the correct way.
I purchased a new rim lock, turned the piece that is spring loaded around so the rounded side is the correct way when shutting the door, but to lock, you have to put key in upside down and turn key as if you are opening it.
Are rim locks handed ? As mentioned the old one worked ok.