Well, leaving any heating appliance on overnight is a fire hazard. This goes for electric/gas heaters and stoves. If you’re trying to stay warm throughout the night, you can turn it on or off in intervals.
Alternatively, you can warm the house for a while and then turn it off. Make sure to close all windows, drafts, and doors, or else the heat will escape. Leaving the fireplace insert on overnight may also cause carbon monoxide poisoning (as mentioned above).