Quote:
i know how debugger works
Your question tells us that you don't know how debugger works.
The debugger is a tool and like for any tool, you need to learn how to use it.
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
Advice: take a sheet of paper and try to do the algorithm by hand, your program should use the same procedure.
On the sheet of paper, note all changes in your list after each steps of the sorting. It is a linked list, only the links to head and next must change.