Calling cops and doing it with their help covers your ass.
The new "owner" will keep the bike as he has bought it in good faith. The shop will claim that it cannot check every used bike. The rightful owner could try to get money from the person who stole it (if found), but they most likely don't have any money.
It's the perfect crime and the reason why we cannot have nice bikes. People are literally sleeping with their expensive bikes in a room.
No stolen bikes end up in shops, no siree. Yeah right.
Of course this depends on the police not being lazy which clearly is a big ask but if that is too much any law is pointless.
For example, in Sweden, if it's been more than 24 hours, it's illegal to do it on your own.