Dotnet project to Nixpkgs failing because of denied permission to obj/

I’m trying to make a nixpkg for a dotnet project, BTCpayserver (and its dependency NBXplorer).

My build is failing because dotnet tries to access /nix/store/XXXNBXplorer/NBXplorer.Client/obj/ and get denied because of permission.

How do you solve this?