Fire rainbows appear when special conditions are met. First is the passage of light through these high-level cirrus clouds at a specific angle. The next factor is the  position of the Sun. A fire rainbow can only be witnessed when the Sun is at least 58o above the horizon.

Ice crystals through which the light disassembles into constituent colors needs to be hexagonal in shape, with their faces running parallel to the ground.

When light enters through the vertical side face of these ice crystals and leaves from the bottom face, it refracts,  (i.e., it bends). This bending of light is tantamount to light bending through a prism.
If these crystals are aligned perfectly, the whole section of the cirrus cloud behaves like a prism, resulting in a rainbow-like appearance.