`@phpstan-assert` isn't working with Union - part 2

Bug report

in phpstan/phpstan-src#4900 we added support for @phpstan-assert on unions.
I think the implementation is wrong, as the snippet suggests

Code snippet that reproduces the problem

https://phpstan.org/r/9a1e59a3-dba3-41b4-b097-ab84f6f98e4f

Expected output

no errors

Did PHPStan help you today? Did it make you happy in any way?

No response