Question about Ungraded Lab - Improving SQL Generation

I have a question about section 3.1. Use an LLM to Query a Database:

It looks like the notebook already know that the SQL query is wrong, even knew exactly the output (-190571.46).

I thought the LLM output (the SQL query in this case) is non-deterministic and we can not predict the generated SQL hence the query output?