It's not the best approach, but in the face of homelessness, if as far as the landlord is concerned, you never moved out, you could just say there was a mistake at the amt, they automatically deregistered you when a letter went stray and didn't arrive, and now you have to correct it with a re-register.
Amts deregister people automatically all the time (even though they shouldn't) when mail doesn't get delivered / lost in post / name tag falls off bell / whatever.
The landlord could decide to dig further though. But let's face it, Amts right now are impossible to get hold of due to staff shortages / Amt staff temporarily being re-assigned to Ukraine welcome centers / civil servants retiring and nobody wanting to replace them. So good luck to the tenacious landlord who has the patience to spend hours sending emails / making phone calls to Frau / Herr whoever who no longer works there, or only between the hours of 07:00 and 08:00 once a month in a leap year.
HOWEVER... If you have a good relationship with the landlord, and a good fingertip feeling that they wouldn't hold it against you (not likely with a faceless Liegenschaftverwaltung) then ignore all of above and come clean.