In Typo3 v12 and later you need to replace typo3cms with vendor/bin/typo3 as the command typo3cms has been removed.
typo3cms
vendor/bin/typo3
(Disclaimer: this is not an answer to the user's problem)