This seems to be solution `nix profile install <flake>` fails on macOS with multi-user installation · Issue #5296 · NixOS/nix · GitHub
Also mentioned here Dealing with `path xyz claims to be content-addressed but isn't` - #2 by jayeshbhoot