It must be frustrating for you that your city has introduced these new restrictions. @Alex-and-Monica0 (when did they first talk about doing this?).
Sadly for you if your city has brought in regulations saying you can't host remotely then you shouldn't be hosting.
Your code enforcement guy was perfectly within his powers to check your accommodation. It turns out he was correct - you are continuing to host despite being denied a permit which in most locations is against the law and can lead to heavy fines . It was not harassment.
Are you absolutely surely your neighbours were being picky rather than your guests being anti-social/noisy so that's why police were called?
In terms of help you could consult a lawyer but the city regulations seem pretty clear cut. Perhaps look at long term rentals.