In a way, LLMs tend to follow a very reasonable practice of coding to the API you'd like to have, and only later reconcile it with the API you actually have. Reconciling may be as simple as fixing a function name, or as complex as implementing the "fake"/"hallucinated" functions, which work as glue code.