What the research shows
Unfortunately, electronic roach repellents don’t actually do what they say. Multiple university and government studies have tested these devices directly against German cockroaches (one of the most common species found indoors).
A study published in the Journal of Economic Entomology tested ultrasound at a range of frequencies against these cockroaches and found no meaningful repellent effect. A separate laboratory study from Kansas State University reached the same conclusion, reporting that ultrasound "failed to repel... German cockroaches at the different frequency ranges evaluated."
Electromagnetic devices have fared no better: an investigation by the U.S. Environmental Protection Agency tested several commercially sold electromagnetic devices against cockroaches and other pests across more than 20 trials and found no demonstrated effect in any of them.
Even where researchers have observed roaches reacting briefly to a new sound, the effect doesn't hold. The general consensus seems to be that pests can become accustomed to a stimulus once it's clear there's no real threat associated with it, a process known as habituation.