It is occasionally possible to aquire items lying around in villages without trading. To make this happen you must take an item unseen by any villager from the ground, drop it again and then leave it alone. The item must have the property "taken" then. After this you could leave the village and revisit it much later. Then you might take the item as yours without any trading.
I think technically it is stealing but if the taken items remain in the village the villagers should reclaim them.
I've already found this issue in version 3.32. I'm sorry that I didn't report it earlier.