It would be interesting to see how you’ve done it, but as this is a universal problem that is discussed in @CaptainAwesomes amazing notes.md, it is already catered for both by way of turning off the DevNonce checks during development because during development, this is an issue for all platforms.
More subtly than the bold faced assumption that OTAA is the way to go (it is) which means we just assumed peeps would head for the Starter or the Reference sketches, is the extensive ESP32 only examples you can get here: GitHub - radiolib-org/radiolib-persistence: Utility functions for enabling persistence, mainly for LoRaWAN support in RadioLib and the magical auto-pin-configulator here: GitHub - radiolib-org/RadioBoards: Crowd-sourced database of radio module pinouts.
It’s only really ESP32 that HAS to save all the join & counter info, most other platforms have a deep sleep mode that retains RAM.
I’ve got a few commercial devices out in the field using a variety of different MCU platforms which is how @stevencellist (developer) and @CaptainAwesome (test victim bunny) bottomed out the vast majority of issues by end of 2024, particularly for the ESP32 and the rather nice Heltec CT-62 module.
Subsequently, Mr Cellist has resolved the corner, insane & just-plain-stupid cases to ensure it passes the pre-certification tests prescribed by the LoRa Alliance.
The certification tests are identical but are performed with more expensive computers in an anabolic-steroid chamber to justify the removal of £/$/€10,000 from your bank account. I’ve yet to figure why this is required if you follow the published reference designs to the nearest milli so that the RF is demonstrably good and, well, the firmware works to the tests which is not necessarily the same as the specs. As Semtech provide two reference codes bases, I’m totally at a loss as to what is being tested if you use either of them as the basis of your code. Although we know now that the Semtech code doesn’t always pass all the tests, go figure.
We haven’t got as far as publishing TR007 code, because M won’t authorise it.
Tl;DR: Already fixed, but feel free to post your code in the Discussions section of the repro as it helps junior younger coders like Steven learn from others. 
I’ll ask CA to update the notes regarding ESP32 persistence and pin-maps.
PS, when embarking on something that should be obvious for the stack, go for decaf and ask here or on the repro as it’s likely been done already.