Metabase not able to connect with Trino: Prepared statement not found

I am not able to connect Metabase (0.50.27) to Trino (464) due to:

Query failed (#20241128_152558_00014_4bsm4): Prepared statement not found: statement1

In addition, I see the query failing with USER ERROR — NOT_FOUND but if I replicate the queries from the CLI everything works fine:

Same as this issue