"They then tried to charge me $170 for the diagnostic.. "
As someone who works at a dealership, I hate this. Do you expect them to work for free? If you want a free diagnostic go to Autozone or OReillys. Yes it sucks that its that much but thats literally just how it is. You can get a cheaper diagnosis at a mom and pop shop but most of the time you're paying for the experience that techs have at a dealership. That is, assuming you took this to a dealer. If not, $170 is definitely high for a independent shop, but that is depending on your area. Not saying every dealership/shop is great. But not ALL are trying to scam you. Our labor rate here at my dealer in Missouri is $175 an hour and thats actually the cheapest in our town. Regardless, my point stands, every shop is gonna have difference rates. No one ever likes paying for it.
On topic. If the fan was actually exactly $300, they already took $43.63 off MSRP, so it looks like they discounted a little. Rock Auto is able to sell OE stuff cheap af because they buy shit in massive bulk/directly from the manufacturer and have MUCH less markup. Doesn't always mean its good because it could've been something thats been sitting on the shelf for years. I use rock auto, not bagging on them but definitely don't always go for them. Especially if the part you're getting has rubber or seals on it because they're probably dry rotted if its on wholesale clearance for example.
Having to recharge the A/C is definitely bogus. This makes me think you didn't take it to a dealer or the advisor you talked to was a moron. I looked in the workshop manual just to double check and there is nothing about recharging a/c when replacing the cooling fan.
On Alldata, which most shops use for labor hours, it shows 0.8 hours for replacement. So the $900 is definitely ridiculous. With it being 0.8, assuming for diag they do 1 hour so that usually means their labor rate $170 per hour and fan $300 you should be around $450-$500 with tax. They quoted high because they either don't want to do the job or don't know that it takes tbh.
Not trying to flame here, I just know what usually goes on behind the scenes at dealers/shops and it makes it look like they're trying to scam when they're just going by what they know/their policy.