This one can be a bit of a pain.
It's the first portal/level of the final world and you can't kill any rats which sucks because those little guys are your butterfly fodder. you CAN get hurt, you just can't eat any butterflies or gte Sparx back when he's gone.
i suggest running through the level without collecting gems or killing enemies, freeing dragons so you have a checkpoint in case you die since you cant refill Sparx's color.
once you've gone through once and gotten the trophy you can go again and do the collecting.