Hi,
Here is an article from “myrandomtechblog” that explains one fix for the issue.
https://myrandomtechblog.com/automotive/sunbaruimpreza/subaru-abs-light-fix/
It seems to cover what you are describing in the title and looks to be a relatively easy fix.
Apparently there was a Subaru recall back in 2019, but it’s probably a part that will continue to need replacing every so often unless an aftermarket supplier makes an upgraded version of the switch.
Hope this helps