Merhaba You were right to react the way you did.
Any government department wanting to contact you, especially in regard to income and benefits would write to you first. This letter would contain, as well as your name and address, also your National Insurance number. They would never address a letter of this type just to 'The Occupier'
Even if they contracted the visiting to an agency, the agency worker, would have your name and full address including post code and I would expect them too to have your National Insurance number. They would also have a document and pass identifying who they were, and you should also look at this document/pass as well.
I notice when they asked you to ring they wanted you to give your name address and National Insurance number. That was so they could fake a letter to you. If someone does this again. givethem your name and ask them to give you your National Insurance number. They will nto be able to.
This was undoubtedly a scam and you dealt with it exactly as you should.