Raise notice if type hint is not matched (in addition to exception)

This helps a lot in bigger code bases, especially if exceptions are catched or masked.

The thrown exception prevents that the value gets returned but the notice helps to identify the source even if exceptions are handled with catch-all blocks somewhere in the stack.