I have recently added a new root source css file for magento storefront by putting it in default_head_blocks.xml throught below statement.
Now I ran upgrade command
php bin/magento setup:upgrade
I am having the same custom.less file at below path of my custom theme.
When I now try to run deploy command Magento is giving me an error
pub/static/frontend/myvendor/mytheme/en_US/css/custom.css): failed to open stream: No such file or directory
I don't know if this is a version issue or not but I already tried signing off static files from backend by setting
store>configuration>advanced>Developer>Static File Setting>Sign Static Filesto No
as well as trying to run the command again with admin rights.
Still, the error persists.