From looking at your code, I'm not sure what you're trying to do makes sense.
In your example, newRow is initialized to the number of rows in your table - which seems to be 4, which is a normal answer.
The row() function on QTableWidget will return the row number the given item appears on. Since you are giving it the vertical header item for your row, it returns -1, because the vertical headers are NOT considered to be in a row -- they are separate from the "content rows" of the table widget. This is the expected behavior.