Please be careful with backing up photos with immich.
They define uniqueness as "${filename-with-extensions}-${filesize}".
How many times does your system have IMG_4223.jpg? I got many. Different cameras, iPhones, etc, all started at IMG_0000.jpg.
How often does the file size collide? I don't have stats, but the reason I know this is because I had multiple occasions of failed backups and imports.
That is terrible. I have a number of issue reports open with immich but didn't know about this particular snag. Has this been reported to their GitHub?