I have just looked up the location of openssl:
command: which openssl
output: /Applications/XAMPP/xamppfiles/bin/openssl
To confirm that i do have openssl installed through brew as well
command: brew list | grep openssl
output: openssl@3
So could it be that openssl in XAMPP is interfering with the installation?