I managed to successfully reflash, now I just need to restore stuff like contacts, call logs, files from the backup I made. The trick was to download the image, decompress it, then run the update script like this:
./scripts/librem5-flash-image --dir . --stable