legally, it is that paper receipt (bill of sale) that transfers ownership of the merchandise in question
You are 100% correct. The shop owner has a right to make sure you didn’t shoplift something.