The application "XQuartz" can't be opened

Solution 1:

The issue was my .zprofile file. I recently installed Intel oneAPI and I had the initialization script in the .zprofile file. I moved the script to the .zshrc file, and now everything works properly.