I wouldn’t throw them in the trash, at the least they’re quite valuable on the second hand market.
On the other hand, you may be able to salvage your local network issues. If you haven’t, make sure you reboot your router while the Sonos are unplugged. This ensures all sorts of things that might help.
However, if this doesn’t work, I’d wire at least one speaker directly to your router, then submit a system diagnostic, and call Sonos Support to discuss it. Don’t post the resulting diagnostic number here.
There may be information included in the diagnostic that will help Sonos pinpoint the issue and help you find a solution.
When you speak directly to the Support staff, they have tools at their disposal that will allow them to give you advice specific to your network and Sonos system.