In addition to the impact on visa renewal, if your status of residence expires while you are in lockup, you will also find yourself charged with overstaying, which means deportation and a ban on re-entry as well. If you are a permanent resident, you may lose your PR status if your residence card expires while you are in prison.
Funny you should mention this. Nearing the end of my stay in Japan, while employed direct-hire by a BOE, I accidentally let me "instructor" visa expire, or whatever the title was. This was back when I think they were still 1-year visas. Completely my fault, realized what I'd done maybe a week or so after expiration date. I start panicking and scouring the Gaijinpot forums where the general consensus is that when I go to the immigration bureau I'm going to be detained, transported to the airport in custody and then deported. I considered going home and packing up my emergency cash reserves and anything valuable and bringing them with me, and also informing my department at work that I may not be coming back again. I decided I'd just take my chances and try my luck.
I guess this is where, as always, it helps to be a true-blue ethnic Cousin of Tojo. Being a "teacher" at one of the most prestigious schools in the prefecture probably helped, also. I showed up at the Osaka immigration office dressed in the most teacherly get-up I could think of (wool v-neck, shirt, tie, slacks, silver-rim glasses and briefcase), explained to the young lady at the counter what I'd done, she calls her supervisor over, they exchange some whispers, I give the most exaggerated "MOSHIWAKE GOZAIMASEN!!" I ever belted out and my best attempt at a pre-harakiri bow almost smacking my fucking face on the desk, and twenty minutes later I'm on my way with everything straightened out. I don't recall the details but my visa was renewed for my final year of teaching.
But I never, ever, ever left home without my gaijin card. I actually still have my first one as a memento. Obviously, I was supposed to surrender it to my ward office during renewal but I wanted a keepsake so I informed the staff that I dutifully cut-up and disposed of my old expired card but would go back home, retrieve the pieces and bring them back to the office if it pleased them. They said it did and issued me my new card. I left and never came back again. Gotta love that Japanese honor system.