Is this insulation supposed to be there?
This is sometimes rock wool insulation. Even if not, fiberglass insulation is non-flammable, as long as no vapor barrier is used with it.

Installation of fireplace doors and fireplace inserts usually includes such insulation.