This did the trick for me:
if #available(macOS 12.3, *) { config.preferences.isElementFullscreenEnabled = true }