Dear @bobthebear , @MiguelOrtiz thank you so much for your feedback and kind comments.
I have finaly solved this problem after one week of back and forth, and actually I tested all your methods before as I had enough time to read most of posts related to this type of issues.
But the problem was different and now I would try to explain the bug.
There's no any errors in this part of script, but it turned out that before I was using another Action type, which off course not used for a year already, but for some reason the engine still processing it and giving errors. Please see the screen below.
I have to say it broke my brain at some stage, as even deleting and creating the query with the same name as well as duplicating saves this unused tails, even if they are not used or selected.
Thus my conclusion is - Always remove all code and don't count that if you don't call / choose it it won't work... No, it would / may (you never know).

