I did something similar (that my professor still talks about in class as a cautionary tale)
I ran chown -R user .*
(intending to target all hidden files in the folder) and for people that don’t know .*
also matches ..
(..
was /
in this case) which changed the permissions on all files on the system to that user, including sudo.
We fixed it by mounting the root of the file system in a docker container which effectively gave us root.
This might help in the future in case you setup a remote mount for backups in the future. Look into using systemd’s automount feature. If the mount suddenly fails then it will instead create an unwritable directory in its place. This prevents your rsync from erroneously writing data to your root partition instead.