do not use deprecated GDAL import
QGIS on macOS uses GDAL 3.2.1 that removed the deprecated import of GDAL, please see https://pypi.org/project/GDAL/ To support macOS 3.16 LTR and macOS 3.18, please fix the code with:
try:
from osgeo import gdal
except ImportError:
import gdal
details: https://github.com/qgis/QGIS-Mac-Packager/issues/114