SDL_DestroyTexture after SDL_DestroyRenderer triggers an assertion in SDL2

While struggling with the port of Exult to iOS, I always triggered an SDL assertion in SDL_render.c CHECK_TEXTURE_MAGIC.
In Exult’s code we first use SDL_DestroyRenderer(screen_renderer); and then SDL_DestroyTexture(screen_texture);
For some reason this seems to corrupt the texture on iOS but when I exchange these two destroyers, no assertion is triggered.

So my questions are, is it genereally advisable to first destroy the texture before destroying the renderer and why isn’t this corrupting the texture on Linux, OSX, Windows (or not triggering the assertion)?
Especially why it doesn’t assert on desktop machines is what I’m wondering about.

(code of Exult now changed the order of those but you can see it at