Your problem description is not too clear.
What does "variable that rests" mean? (Typo for reset?)
Do your rooms stay around when empty? (They can automatically go away entirely when the last client exits.)
What do you mean by phantom client?
Union Admin not showing said client under Clients, but still a room Occupant? [that should be impossible]
Do they stay persist? Sometimes if a client disconnects, it takes a while until the server detects it fully. Usually that time interval corresponds to your timeout value, and you see log messages along the lines of "No communication from Client for xxx seconds - disconnecting." (Paraphrasing there.)
If they do appear in Union Admin, can you Kick them?
What happens if you Kick them prior to their disconnecting?
How are you detecting the empty room condition?
If you are just keeping your own count, it could get out of sync if somehow you miss a "client added" or "client left" message.
As for workarounds ... you could periodically check the room's Occupant count if you wanted,
but that could mean a delayed response (and also possibly open up a timing hole if your check
and a client coming or going happen at the wrong times).
I would try to keep any workaround as simple as possible.