"How do you fix it?"
Here's a suggestion which may help although I don't claim it is the silver bullet.
Limit the number of call origination attempts from any particular line on a per minute, per hour and per day basis. This is a limit below the inherent limit imposed by the capacity of the network.
I have a paid for IMAP/Webmail service as I'd rather pay than use the usual personal info snooping suspects. Despite being paid for (they have no free option, only a short free trial with much lower limits) they still impose limits on the number of emails sent to prevent people sending bulk/junk emails. In normal use (even business) you shouldn't hit the limits unless you're definitely up to no good.
All outgoing calls placed (even invalid numbers, engaged and voice mail etc) count against the attempt limits to prevent randomly calling numbers to build a list of valid numbers.
There is a chance you may hit the call limits if you're trying to phone up for e.g. high demand concert tickets but I suspect the limit can be set to a level that curbs the spammers but also doesn't impinge on 99.9% of subscribers.
Once someone hits one of the call origination limits (per minute/hour/day) the network locks the line into incoming calls and 999 only for 24 hours after the attempt that hit the limit. Since this would hit telco revenues it would require legislation. Some companies may get around the limits by installing extra lines to keep their calling within the limits. That's fine since their costs would escalate massively threatening the viability of their business model. Alternatively allow higher limits per line only if the company pays 100x across ALL their lines.
Icon: Robocaller not only wants your clothes, boots, and bike but also wants you to press 1 if you've had an accident in the last five years.