PID autotune fails with a temp too high
As the heating curve is very steep, it could be that the wrong cartridges are inserted, or you have been supplied the incorrect cartridges. (Not long ago I've had a similar experience with a 12 V cartridge in between my 24 V spares...)
To find out for which voltage the cartridge has to be used you can measure the resistance with a multitester/multimeter. You can calculate the resistance roughly by using the formulas:
$$ U = I \times R$$
$$ P = {U}\times{I} $$
Combing these formulas gives:
$$ R = \frac{U^2}{P}$$
(P is power in Watt [W], I is current [A], U is voltage [V] and R is the resistance in Ohm [Ω])
Your multimeter readings should be close to the calculated values. About 4 Ohms for a 12 V/40 W cartridge and about 14 Ohms for a 24 V/40 W cartridge.
Since the Ender 3 is running on 24 V, you need the higher resistance cartridges.

If you are using a 4 Ω (12 V/40 W) cartridge on 24 V, the power would become:
$$ P = \frac{U^2}{R}= \frac{24^2}{4}=144\ {W} $$
This amount of power will quickly raise the temperature of the nozzle! It then becomes very difficult for the PID control schedule to harness that power (e.g. overshoot control).
From the question is read that:

I used 24 V heater cartridges rather than the 12 V ones that came with the hot end

If the cartridges are truly 24 V this rapid heat-up is not expected, it could be that you accidentally received incorrect cartridges, you should measure the resistance to be sure.