I faced the same problem when installing Gazebo from source. I solved it by manually search for MACOSX12.1 and replace all of them with MACOSX12.3 in my /build folder where the .cmake files were stored.