### Godot version

v4.0.beta13.official [caacade56]

### System information

Windows 8.1

### Issue description

The `Unreachable code (statement after return) in function 'function_name()'` warning is given for functions that do not have unreachable code. The same code does not give this warning in v3.5.stable.official [991bb6ac7].

### Steps to reproduce

```
func warning(i: int) -> void:
  if i == 0:
    pass
  elif i == 1:
    return
  else:
    return
  print("yeah")
```

Removing either the `elif` or the `else` removes the warning.

### Minimal reproduction project

N/A; code in reproduction steps can be placed in any blank gdscript file to trigger the error.
PatternNode *sub_pattern = alloc_node<PatternNode>();
						complete_extents(sub_pattern);
						sub_pattern->pattern_type = PatternNode::PT_REST;
						pattern->dictionary.push_back({ nullptr, sub_pattern });
						pattern->rest_used = true;
					}
				} else {
					ExpressionNode *key = parse_expression(false);
					if (key == nullptr) {
						push_error(R"(Expected expression as key for dictionary pattern.)");
					}
					if (match(GDScriptTokenizer::Token::COLON)) {
						
						PatternNode *sub_pattern = parse_match_pattern(p_root_pattern != nullptr ? p_root_pattern : pattern);
						if (sub_pattern == nullptr) {
							continue;
						}
						if (pattern->rest_used) {
							push_error(R"(The ".." pattern must be the last element in the pattern dictionary.)");
						} else if (sub_pattern->pattern_type == PatternNode::PT_REST) {
							push_error(R"(The ".." pattern cannot be used as a value.)");
						} else {
							pattern->dictionary.push_back({ key, sub_pattern });
						}
					} else {
						
						pattern->dictionary.push_back({ key, nullptr });
					}
				}
			} while (match(GDScriptTokenizer::Token::COMMA));