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
detto for from ogr, osr,gdal_array and gdalconst imports
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:
detto for from ogr, osr,gdal_array and gdalconst imports
details: https://github.com/qgis/QGIS-Mac-Packager/issues/114