I can short circuit an Arduino pin for days, or (attempt to) pull 3 or 4 times the rated current from them - and they just keep on rocking. I've even accidentally hit them with 7.2V or even 12V on the GPIO and not had them let the magic smoke out.
You only have to look sideways past a 5V rail at as RasPi to kill it, and ESP aren't a heap better.
If I can get all the code I need onto an Arduino/AVR, I'll use one. If I need more complex code than I can run on an Arduino but still need GPIO (especially anything 5V tolerant) I'll use an ESP or RasPi (or some other Linux SOC board) with an Arduino (or other AVR) for GPIO. At least for the prototyping stage when I'm using breadboards and moving wires around - if I'm building something permanent (or at least semi permanent) I'll sometimes build a version 2 with level shifters to deal with 3.3-5V stuff, but mostly only once I've got to the "prototype that's got to the PCB stage" iterations. I've almost never killed an Arduino, but I've killer too many RasPis and way way too many ESPs.
So if you limit the input current (typically <5mA, and assuming the steered-to rail uses at least 5mA to sink it) it will survive any voltage. (Of course if it's a low power design or the device is off this wont work that well, then you want external clamping)
I have tested 24V AC applied to an stm32f0 pin with a 10K series resistor and it survives that indefinitetly.
Which mode was the pin in? I'm not an STM person but my understanding is that most MCU pins are tri or at least multi-mode, if you have the wrong mode set it's effectively isolated.
Edit: Can't reply to child. Schmitt trigger circuitry is disabled if pin is in analog mode or is an ADC pin according to https://www.st.com/resource/en/datasheet/stm32f071cb.pdf page 59 .. could affect sensitivity ... perhaps there exist other mode-related influences, too.
esd cell -> optional pull ups/down -> schmitt trigger.
there do exist cmos chips with pins without input clamping diodes but they are rather exotic usually
Unless I really need WiFi, I prefer to go with ATmega. Once you get used to writing structured assembly language, you can get so much more functionality fit within flash memory.
All of these chips have devboards in the order of $20. Surely you could have built a code prototype with a devboards before designing up a PCB?
In the embedded world, timers are very specifically designed. Yeah, TimerA is more flexible and maybe you needed more of that, but the less flexible TimerB on AVR is more power efficient (like 1/3rd the power or something). So TimerB has it's other uses. (Really, I'd say TimerB is specialized at frequency counting tasks but is less good at PWM or other "output" tasks. So TimerB is kind of an "input timer")
And TimerD is this weird behemoth that I don't understand yet. But someone probably used it for something good out there...
--------
But given the nature of TimerA vs TimerB vs TimerD (as well as the knowledge that TimerA is on different pins than TimerB), surely that should have cued you into the point that you should prototype your design?
Don't lock down your PCB until you have idea of what wires should go to which pins. And part of that process is deciding if TimerA vs TimerB vs TimerD was what you needed.