I’m trying to change the nameservers for my domain and get nRRPResponseCode 531/541 error message
Error nRRPResponseCode 531/541 means that the nameservers you are trying to set up are not registered yet at the registry level, so you need to make sure they are registered before updating the domain. Please contact your hosting company that provided you with the nameservers for more information.
If you want to set up private nameservers based on your domain name (e.g. ns1.yourdomain.com, ns2.yourdomain.com) and the domain is registered with Namecheap, see this article.