Plugin unable to load template part 3

I’ve noticed a strange thing. I’m writing a plugin in 5.2 style with controller auto registration. At the beginning plugin worked ok, shows a simple window on backend. When I’ve added code responsible for writing data to database I got error snippet app.js not found.

The line of code that breaks plugin is $shop->registerResources(); 

Any idea, why is that?