Chain comes off under high load
I would look for a bent or damaged chainring tooth or even a bent portion of the front chainring. Depending on the damage it can behave “normally” under a low load, but eject the chain under a higher torque load.