Arduino MKR WAN 1300

That’s not enough; you also need to store the counters, the ADR state, and much more; see OTAA best practice: how to not join every time? I’d assume that would also solve your problem.