Yes, the rolling over on his back does not sound good. I know a few people that have just have funny loaches that like to lay like that on occasion (for a joke maybe? ;o) ) But it does not sound like that is normal for yours.
Not to scare you, but loaches can be touchy, especially if you get one that is sick. Out of 4, I've only had one that stayed alive. The other three did not last a week, in fact, 2 of them died one within hours of getting home, the other 2 days later.
I only have one now, and I've had him for awhile.
It is really sad that he is gasping, I'm so sorry, and I hope that he pulls through and gets better fast.
If he does die, try not to feel to bad, because they are really touchy, and he sounds like he was not at all well when you bought him.
I was afraid to buy more after my first two died within hours/days, but I am glad that I did. Because they are such funny little fish
(((((Hugs))))) and I hope that your loach is feeling better soon.
Does he have somewhere to hide?
Jessica