Lilygo T-Display-S3 Factory example compile error

That is not the correct installation procedure. Unfortunately the installation instructions are very low quality so it's not surprising if you weren't able to extrapolate the correct procedure for macOS from them:

https://github.com/Xinyuan-LilyGO/T-Display-S3?tab=readme-ov-file#4️⃣--arduino-ide-manual-installation

  1. Copy all folders in lib folder to Arduino library folder (e.g. C:\Users\YourName\Documents\Arduino\libraries)

I'll do what "LilyGO" was not considerate enough to do and provide detailed instructions you can follow to install the library dependencies of the project:

  1. Select Arduino IDE > Settings... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Take note of the path shown in the "Sketchbook location" field of the dialog.
  3. Click the "CANCEL" button.
    The "Preferences" dialog will close.
  4. Click the following link to open the GitHub repository homepage for the project in your web browser:
    https://github.com/Xinyuan-LilyGO/T-Display-S3
  5. Click the "Code ▾" button you see on that page.
  6. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  7. Wait for the download to finish.
  8. Extract the downloaded file.
  9. Copy the contents of the lib folder from the extracted folder to the libraries subfolder of the path you saw in the Sketchbook location" preference.
    The folder structure of the installation must look like this:
    <Sketchbook location>/
    ├── libraries/
    │   ├── lv_conf.h
    │   ├── lvgl
    │   │   ├── library.properties
    │   │   ...
    │   ...
    ...
    
    (where <Sketchbook location> is the path from the "Sketchbook location" preference)