Required parameter '$registry' missing, when trying to use Component from Command

I ended up moving all required functionality to few service classes to solve this. Took quite some time to do it, because these functions we used quite much in other parts of the application.

@jmcd73 Thank you for suggestion, I will test that even though I already moved to service class

@KevinPfeifer Thank you for good video, I founded that video before I wrote this message and ended up using that video as study material. There was one part, which did not work in my setup (cakePHP 5.0.6). I had to change $this->loadModel() to $this->fetchModel().