However, for more complex validation or other types, it is better to have a manual validation. For example for a string or an array it would be better to check if the returned value is the right type rather than casting which could lead to a fatal error.
It is also important when we have more constraints on the output from the filter than the type to check them.
For example for a price it is possible to check it that way.
Note: It is important to understand this notion also applies to the values we expect inside the callback.
This is why it is important to never includes inside the function parameters from the callback the types. Otherwise, this could lead to the whole website crash due to a fatal if a previous callback returns an invalid type.