Probably a tight link. This often happens with a new chain. The tight link is usually the one where the chain was joined. A tight link may fail to unfold and lie flat as it comes off the back of the chainring. When the folder link reaches the rear derailuer it stops suddenly at the tab and inertia twists the deralleur off the frame.
The mechanic should have.checked for a tight link.