The pin mapping shenanigans are another annoying footgun with Arduino. Even in native development you're dealing with a physical pin number and the logical assignment (PA5, PA6, etc), but now Arduino maps that all again to an Arduino board pin number, and it's all shuffled to ensure the peripherals are in the right place to enable I2C, ADC, and PWM pins to function as expected.
Same deal exactly for the various ESP32 boards. With the added wrinkle that some of them (like T-Display) have had pins swapped in the doc at various stages.
Of course they did that. It's a HAL (hardware abstraction library).
That also means that simple projects are abstracted from the hardware. Means I can go across a dozen different CPU arch and board/pin layouts, and I change nothing in my source. I only change my target and it just works.
I did that when I went from a board operating at 16MHz/atmel to a STmicro running 50MHz. No change in my source. And that's really valuable in rapid prototyping.
Once I settled in on a board and everything, I could do it the "right way" aka the old waterfall-gile embedded approach and get things tweaked and optimized.