Cosmo was never a member of the Guardians. He was head of security for Knowhere, where the GotG based their headquarters out of. But so did a lot of other groups. In fact, Cosmo was repeatedly accused by the other lease-holders of showing favoritism to the Guardians and letting them put Knowhere at risk. The fact that he was an actual neutral party between those groups (although he did cut the Guardians a lot of leeway) is a major point with his character.