Your Gcode files ran correctly here without any sloping of the sides.
Interesting that you have the feed-rate set at 12,000 mm/min which an axis would not achieve over such a short distance as the zig-zag path. When I set the correct laser power for maximum velocity on the long strokes over-burn was created on the zig-zag. This results in pretty poor engraving results as can be seen in my pic. and it is really not the correct way to laser engrave anything.
I think you need to create a better toolpath and run at a modest feed-rate and see what results you get then. Something else worth trying (and this may correct your sloping sides) is changing your Ports & Pins / Motor Outputs / Step Low Active to Active Low (tick) for the X, A and Y axis.
Tweakie.