In most instances, a type mismatch between the schema of the actual row outputted by the function versus the expected schema causes an exception to be thrown. However, you should avoid a type mismatch between the actual and expected row schema as much as possible as it can cause a Postgres failure in the worst and rare case.