I have seen the City condemn places after an investor type buy’s it, they seem to wait until after a sucker closes then they come in and condemn the place and say you either have to tear it down or rebuild a good part of the place, but these are usually very old homes in very bad shape or just very old homes that are not up to code so buyer beware.
It would be nice if they would do this before but they must figure that first you would have to have all cash to buy the place so you would have the resource to fix it, otherwise they get stuck with it.