2.24.10 still has the bug. 2.20 does not seem to be available to me. I managed to work around it using 2.18:
nix run nixpkgs#nixVersions.nix_2_18 -- flake update
If even that does not work, try the alternative method in this post: Nixos-rebuild switch error: adding a file to tree builder - #7 by waffle8946