I was so worried that I rebooted the computer to avoid wearing out the SSD.
Why don't operating systems protect against this?
According to https://www.enterprisestorageforum.com/hardware/ssd-lifespan..., if yours is a 1TB SSD, then you can expect to write 300TB before it wears out. That would take a very long time.
Why not fix your internet connection instead of expecting the OS to fix every conceivable problem? Did you actually look at the logs? Check how much space they took up?