I’ve heard the following rule of thumb:
Your bank has an existing customer relationship with you, so they have more of an incentive to make you a good deal on currency conversion, lest you pack up and leave.
The ATM operator’s relationship with you is literally transactional. They don’t give a crap who you are and even less of a crap once the ATM dispenses the money.
Thus, your bank is less likely to fleece you than the ATM operator, so you’re better off leaving the conversion to your bank.