this is a known issue. The buffer for remembering what has been done is not very large. You will see this happen more quickly with only slab build houses and less with houses build with instant walls as there is less to record for undo purpose.
I think it can happen after loading too. We’ve had many reports about undo broken in the past, and there are plans to improve it (along with the entire building editor).