What is the issue specifically tied to: the flat itself, the building’s rules, or a public restriction? That distinction seems crucial. An inspector can report physical defects, but may not establish whether your intended rental use is allowed.
Also, did your offer make the deposit refundable...