I just had an issue like this on R80.30. Delete greyed out on a gateway object that i had removed from and deleted the associated policies.
No lock icon on the gateway icon, but did a search and found this post, decided to try the API, but when i ran show simple-gateways to get the UID I saw it was locked.
meta-info:
lock: "locked by other session"
I just went to the Sessions in SmartConsole and discarded all users who had any locks, after that I could delete the gateway as expected from the smartconsole. 🙂