Linked List K append - Few test cases failing

If k>n, your code is printing the same linked list which is wrong.
For example, lets say the input linked list is - 1 2 3 4 and k=5.
The correct answer for this is - 4 1 2 3
But your code’s output is - 1 2 3 4