### Godot version

v4.0custom_build[fcba87e]

### System information

Windows 10

### Issue description

Error when trying to call a method with a ternary operator.

### Steps to reproduce

```
extends Node

func _ready() -> void:
	test() if true else test()

func test() -> void:
	pass
```
[fcba87e](https://github.com/godotengine/godot/commit/fcba87e696d58912838d8a4a6987b10efa28e78f) - `Line 4:Cannot get return value of call to "test()" because it returns "void".`

v4.0beta10 - works fine

### Minimal reproduction project

[ternary_bug.zip](https://github.com/godotengine/godot/files/10368477/ternary_bug.zip)

if (branch == nullptr) {
			advance();
			continue;
		}
#ifdef DEBUG_ENABLED
		if (have_wildcard_without_continue && !branch->patterns.is_empty()) {
			push_warning(branch->patterns[0], GDScriptWarning::UNREACHABLE_PATTERN);
		}
		if (branch->has_wildcard) {
			have_wildcard = true;
			if (!branch->block->has_continue) {
				have_wildcard_without_continue = true;
			}
		}
		if (!branch->block->has_return) {
			all_have_return = false;
		}
#endif
		match->branches.push_back(branch);
	}
	complete_extents(match);
	consume(GDScriptTokenizer::Token::DEDENT, R"(Expected an indented block after "match" statement.)");
#ifdef DEBUG_ENABLED
	if (all_have_return && have_wildcard) {
		current_suite->has_return = true;
	}
#endif
	return match;
}
GDScriptParser::MatchBranchNode *GDScriptParser::parse_match_branch() {