Bug report
In the first error, it looks like the instanceof operator does not take into account final classes. In the second, even the message is unclear about why the return type is considered invalid.
Code snippet that reproduces the problem
https://phpstan.org/r/de789d49-1c85-4a3c-b3b8-b71adac4e572
Expected output
No errors.