More than likely you were possibly kicking up small invertibrae or crustaceans, which are the primary diet of such a cowfish. It was thanking you by letting you rub its belly....
OR
You intruded upon its lair and it decided to become "bull-ish" and charge you, only to fall on its side and...