How can true altitude be calculated from pressure altitude, temperature and altimeter setting?
I would think the OAT in the example is what your on-board thermometer is showing, so at 12,500 ft, not at sea level. ISA is +15°C at sea level, but at 12,500 ft it is -9.8°C, so you are just -10 off ISA. Let's see. 4 ⋅ 12.5 ⋅ (−10) = −500, so the formulas match.

Note though, that this is still just an approximation. The temperature lapse rate might also differ and that would have to be taken into account as well. The more precise equation is also nonlinear.