The attachment works, unfortunately in such a manner as to let me know it's not in the g-code. The early M104 line reads M104 S220 T0, which says set the temperature of Tool zero to 220 °C. The next instance of a temperature change is at the end of the print.

This implies that something in your printer is giving up the ghost after a certain amount of time.

If this is a new printer and under warranty, consider to pressure the seller to replace it. If this is not a new printer, it would be good to dismantle it to locate the connection of the heater cartridge to the main board. My first thought is that the connection is poor at the main board and as the heater draws power, the connection heats up, causing high resistance, which takes power away from the heater cartridge. If this is the case, and the wiring is secured by set screws, they can be tightened, improving the connection.

If a new printer, under warranty, opening it up may void the coverage. Not repairing it and continuing to use it may generate enough heat from the poor connection to create a fire.

The g-code eliminates any settings transmitted to the printer.

Another owner of a FlashForge product discovered a loose ribbon cable by removing a panel from the underside of the printer. Unless there are warranty labels, doing so would not void the warranty. Yet another FF owner performed a firmware update on his printer. The former is more likely a solution than the latter, in my opinion.

See if you can get the printer swapped under warranty. Did you purchase locally from a major retailer? Those are usually easier to deal with.