60 amp detached shop able to run 50 amp hot tub?
You should be fine if you install a 50 amp breaker into a 60 amp panel. Just shut the breaker off before using your welder.(Depending on its size it could draw quite a bit.)

The breaker should be sized by the manufacturer at about 125% of the tub's actual load. So like you say it may draw 40 amps at times when the heater is going full bore. When the heater is off it will draw much less than that.

The worst that can happen is you might trip the main in the shop if you forget to turn off the tub.

The only other thing of concern is voltage drop on a large load. Check the voltage at your shop panel while you have a large load on it to see if the hot tub would be undervoltaged or give us the particulars and we can help you calculate the voltage drop.

Happy Monday!