Re: Never do this
The analogy is that you pick up (take control) of the wallet, even if just for a while. You still took it without permission, even if you return it.
Except theft requires the intent to permanently deprive the owner and there's the little matter of mens rea, having criminal intent.
I am sure there might be some officious-a-hole who may try to sling the book at someone who pulled a wallet from someone's bag and tapped them on the shoulder to say "look what I got!", but I very much doubt it would stand up as a criminal offence in court.
Some would probably argue that tapping them on the shoulder would also be assault.