How to fix the «There are no commands defined» failure while executing a console command?

How to fix «There are no commands defined in the “setup:cron” namespace» onbin/magento setup:cron:run in Magento ≥ 2.3.7?