I followed your procedure, not able to set erpnext to staging from master.
it’s very difficult for the layperson to manage this… I’m sticking with Version 10 until a proper upgrade path exists.
you should wait till the v11 actually comes to master. however you can try it on a test instance. and by instance I don’t mean a different server altogether. It can either be a different frappe-something folder (its called a bench instance) or on a different pc
If you face yarn permission error run the below command
sudo chown -R $USER:$GROUP ~/.npm sudo chown -R $USER:$GROUP ~/.config
it solved my issue.