I'm running on Windows 11. It happened to me when I changed the setting of my wifi from "public" to "private". changing it back to "public" solved it.
Which is a bit confusing to me, as I though "public wifi" would mean other devices (my phone) won't be able to see my computer, but turns out in this case it's the other way around. Also I see other users answered the opposite (that wifi should be "private". and turn off MS Defender). Weird.