That was my first instinct as well. But if you look closer you will see, it's actually insertion sort by someone who didn't pay attention in class.
It misses the revelation you can skip already sorted positions when deiciding what goes in the next position.
Btw. Ofcourse it sorts, it's basically insertion sort with extra swaps.