I had a similar thing and it turned out to be a 'cat scarer' :
Cat repeller - Wikipedia
It is supposed to be inaudible to human ears, so I think it was broken.
It has since been removed thankfully.
Other people have reported similar here:
Garden Law Discussion • View topic - Noisey cat deterrent
and here:
Ultrasonic cat scarer high pitch sound ,will the council do anything about the noise? - MoneySavingExpert.com Forums
there are more if you google:
"cat scarer beeping"
I think that it could potentially be heard from a quite a long way away depending on geography/architecture and weather/atmospheric conditions, maybe even through a closed window or even a wall.
Maybe worth having a look around and or asking neighbours if they have heard similar.
they are relatively cheap to buy:
Having looked a bit more on one sellers website* it may not a faulty unit, but one that is badly set:
Frequency Settings
This repeller devices allow you to change the output frequency, enabling you to have the most effective solution for your particular pest problem. Listed below are the types of animals that these repellers can be used against and the most effective setting for each.
Working from left to right (from the smallest dot to the largest)
- Cats - Between 3 - 5
- Dogs - Between 3 - 4
- Foxes - Between 3 - 6
- Squirrels Between 2 - 7
- Rodents - Between 2 - 7
- Insects - Between 2 - 7
- Roaches - Between 9 - 11
N.B If set on numbers one or two the chances of humans being able to hear this are greatly increased.
Also welcome to the forum.
*
Set of 2 PestBye® Battery Operated Cat Repellers £24.99