Do the number of affix of pet fix at the time of getting them?

Thanks in advance.

it has a random number of affix only permanent at legend and eternal pet

My rare pet became epic, 4>6 affix

maybe there was a same affix on your epic pet for example luck affix that have rare and epic on it once your use the pet the epic affix will disappear.

Pets can get affixes when leveled up or via the Buff pet Feat.