Hard to say. Theipfs add CLI talks to Kubo (ipfs daemon) over HTTP RPC at 127.0.0.1:5001/api/v0, either your daemon got killed, or something killed that connection.
ipfs CLI will prefer HTTP RPC if ~/.ipfs/api is present (or %IPFS_PATH/api)
If you can’t figure out what kills HTTP connection to local RPC, you could try workaround: stop daemon and run ipfs add in offline mode, which operates on repository directly, and once finished, start demon again.