Reproducible with the following snippet:
<?php
return rand() ? throw new Exception() : 42;
And test code, using dev-main:
<?php
require __DIR__ . "/vendor/autoload.php";
use Microsoft\PhpParser\Parser;
$parser = new Parser();
$astNode = $parser->parseSourceFile('<?php return rand() ? throw new Exception() : 42;');
print_r($astNode);
The resulting ternary node has an empty ifExpression, the throw expression inside elseExpression, and then the 42 to follow as a separate expression.