Now, some references on latching up:
GPIO Electrical Specifications Raspberry Pi input and output pin voltage and current capability - Mosiac Documentation Web
GPIO pin circuitry
The internal diodes shown in the figure are not really substrate
diodes, but they are actually parasitic FETs.
Electrically, their I-V characteristic looks like a diode's, but with
a greater forward drop and a more gradual knee.
They may protect against low current transient events caused by
transient out-of-range voltages applied to the pins, but they are not
intended to protect against the application of voltages greater than
the supply voltage or less than ground, even with an external series
resistor.
In brief, you should never deliberately forward bias those "diodes".
Consequently, you can not safely place an external pull-up resistor to
5V on the I/O [GPIO] pin. That would forward bias a parasitic FET and owing
to its poor internal impedance to the chip's internal power rail it
may overheat, or worse, it may bias up parts of the chip to voltages
greater than they can handle.
So, don't do it!
Latch-up - Wikipedia
Parasitic structure - Wikipedia
/ to continue, ...