SOLVED
It turns out that as of macOS 14.4 not only is the airport binary deprecated so it no longer functions and instead returns and error message, but CoreWLAN has been changed so that to retrieve SSID names your application needs Location Services permission enabling for it in Privacy & Security in System Preferences.
As far as I can see this later change is not documented here at
https://developer.apple.com/documentation/corewlan
Topic:
App & System Services
SubTopic:
Networking
Tags: