I downgraded all the way to PHP 5.6.40 and the menu worked, but WP_DEBUG showed the following warning:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; theme_MenuItem has a deprecated constructor in /Applications/MAMP/htdocs/osprzemien584/wp-content/themes/osp5/library/navigation.php on line 248
Changing the offending function theme_MenuItem into function __construct resolved the issue and the menu now works on PHP 8.2.20.