Thank you a lot for response!
Problem was hidden in exploding values during taking n-th power of Q, which made loss go to \infty.
Nevertheless, your answers are very helpful since I had no clue it would mess with backprop. Thank once again!