Using overlays cause "cycle detected" error if modified mpv package is present. What could cause this?

The error started occuring with recent version of nixpkgs-unstable. Worked fine with older nixpkgs-unstable (8e3b64db39f2aaa14b35ee5376bd6a2e707cadc2).

Setting overlays like this will always make nixos-rebuild fail:

{
  nixpkgs.overlays = [
    (self: super: rec {
      mpv-unwrapped = unstablePkgs.mpv-unwrapped.overrideAttrs (oldAttrs: rec {
        version = "ec58670a0dc9d4c3970cb4814b2f47ca7011a421";
        src = unstablePkgs.fetchFromGitHub {
          owner = "mpv-player";
          repo = "mpv";
          rev = version;
          sha256 = "sha256-NRxV04IpVNPmgLl+AhPjDXXHUe5u1XXz1DS8cizwn80=";
        };
        patches = [ ];
      });
      mpv = unstablePkgs.wrapMpv mpv-unwrapped {
        scripts = [
          unstablePkgs.mpvScripts.mpris
        ];
      };
    })
  ];
}
❯ nix run '.#nixos-rebuild' -- build --flake '.#b550i'i'
building the system configuration...
error: cycle detected in build of '/nix/store/k5dmwx3iz1vis5lrg0csii9ji1w044cx-mpv-ec58670a0dc9d4c3970cb4814b2f47ca7011a421.drv' in the references of output 'dev' from output 'out'

I uploaded minimal reproducible code here: GitHub - vroad/nix-cycle-test

UPDATE: With outputInclude = [ "out" ]; I can still build mpv, though I’m still not sure what’s causing the error.