Your build problem is exclusively related to Gazebo, no ROS involved here.
You are trying to use Gazebo Classic with Ubuntu 22.04, but in v1.14-beta the setup.bash of PX4
- Installs Gazebo Garden on Ubuntu 22.04 (and removes gazebo Classic, if it was previously installed)
- Installs Gazebo Classic on Ubuntu 20.04 (and removes gazebo Garden, if it was previously installed)
see Simulation | PX4 User Guide (main)
However, you still can use gazebo classic on Ubuntu 22.04, my suggestion is to remove everything gazebo related from your system and then reinstall gazebo classic.
That note is just a disclaimer, it says that the above docs was written for Ubuntu 20.04 and ROS Foxy. However, it works well on Humble too