You had a costly annoying experience, but don't let your aggravation lead you to thinking the shop is crooked.
The shop earns that profit because they are putting up their own capital (or credit) to buy the part for you and because of the time and effort it takes them to identify and order it. Say it takes 30 or 60 minutes to look up -- and search for a good deal on -- and order the part. (How long did it take you to find the bargain on-line, once the shop told you the part number?) That same 30 or 60 minutes could have been spent on some high-tech repair at he regular shop rate.
When the shop said "available only from dealer," they might have meant "not from our usual local non-dealer (maybe after-market) parts sources." Those local sources, including the dealer, usually deliver to the shop within hours. (If not, you have to pay for the shop's time to pick it up.) How long would you have to wait for the on-line part?
Some of the on-line bargain parts are OK quality, and some of them are junk. (Lots of stories on this site about crummy brake rotor steel.) The shop may have been more than honest in declining to use the bargain part. They may have been acting in your interest.
I know all those things, and I am just a DIYer, and I have never run a business.
Of course, maybe the shop IS crooked, but I doubt it.