Is this just bad luck, or can car shops do this if you're not returning their calls???
Of course they can, and it's got nothing to do with luck. It's an extremely reasonable response to being conned. The lawyer should have told him so.
Leaving a high-end car for a minor repair so as to trick a dealer or mechanic into providing weeks or months of free storage is an old con used by people who don't want to pay for climate controlled parking or security. It happens all the time in high-COL areas where it's expensive to park and store a vehicle.
It also sounds to me as though that's exactly what Vanishing Vehicle guy tried to do.
The thing is, the law allows tradespeople to defend themselves against this kind of con job. Vanishing Vehicle guy got his comeuppance when the shop owner exercised his rights under the law instead of meekly letting the Beemer owner screw him into giving up valuable shop space to provide the Beemer owner with several months of free climate controlled parking and storage. (Nobody really likes being forced to subsidize someone else with a higher standard of living.)
Before property can be considered abandoned, there's a minimum amount of time the person it was left with has to wait. Generally there's a process for trying to contact the owner: phone calls, certified mail, and such. But after the time frame expires, the shop owner doesn't have an obligation to keep the car around, having it take up space that could be used to repair a vehicle for a paying customer (the kind that shows up to reclaim their vehicle and incidentally settle up for parts and labor). So they call to have it towed and sold off. They may be entitled to a portion of the sale proceeds to cover the cost of the work they did (mechanic's lien).
If the mechanic didn't defend himself by moving out vehicles that aren't being picked up in a timely fashion, pretty soon he'd have nowhere to work on the cars because everyone and his dog would be using his business as a place to avoid paying for extended parking. There's no reason he should accept liability for being a long term storage facility or let someone's car take up valuable shop space, especially not for free. Besides, there's no telling when the car owner is coming back. For all the shop owner knows, he's dead, in prison, very sick, or otherwise unable to get the car or to have anyone else come and get it. There's absolutely no reason he should be forced to keep the car around or punished for having offloaded it after making a good faith effort to track down the owner.
Anyone who can afford to pay 22k cash for a Beemer can afford to pay for parking and storage while they're out of the country consulting, or can afford to pay for the repairs over the phone and have someone come pick it up. Anyone brainy or skilled enough to get overseas contracts in the first place also has the logistics skill to make a phone call. Sorry, your buddy tried to screw the mechanic and ended up screwing himself. No sympathy from me: maybe he'll learn to conduct himself with basic regard for the people he does business with.