I attempted a hotfix myself to make my site work as per advice here:
https://stackoverflow.com/questions/66671269/fatal-error-uncaught-typeerror-count-argument-1-var-must-be-of-type-cou
// add as optgroup or results
if ( is_countable($args['post_type']) && count( $args['post_type'] ) == 1 ) {
$results = $results[0]['children'];
}