Solution for this error is to downgrade the M5Stack board package from v3.2.1 to v2.1.4 using the Boards Manager in the Arduino IDE. https://www.gonnalearn.com/from-miniz-h-compilation-error-m5stack-arduino/