Did you know you can access the web developer toolbar after running a PHP CLI command?
php bin/console --profile app:my-command

Unfortunately it seems, there are no queries collected in Shopware? But one get a little output, hopefully it helps you!
I ran into a similar problem, that I could not see SQL queries for console calls or in tests. There is now a small feature in the dev helper which might be helpful https://github.com/FriendsOfShopware/FroshDevelopmentHelper?tab=readme-ov-file#sql-logger-for-console-debugging
To see db queries, just install the dev tools:
composer require –dev shopware/dev-tools