Ok, I have figured out what was wrong.
In most scenarios, we use Givens/Jacobi rotations Q_{i,j} acting on rows/columns i and j and want to zero out an element A(i,j), for example, in computing QR decomposition or using Jacobi rotations to compute eigenvalues for symmetric matrices. But here we do not want that, and instead we want to use Q_{i,j} and zero out an element A(i, j-1).
Why?
When we use Q_{i,j} from both sides we create linear combinations of i-th and j-th row/column and for element A(i,j) we add both the other column and row, which makes it harder to keep track of what we are doing.
But if we want to zero out the element A(i, j-1), we only create the linear combination with the row j, which is easier to keep track of. Essentially, what we are doing is using A(j,j-1) to zero out elements A(j+1, j-1), A(j+2, j-1), ..., A(n,j-1) for the column j-1.