ChatGPT, at a UI level, does tag code as code; so even though the LLM part doesn't itself have the capacity to delegate, it can certainly be used in this way as part of a larger system.
What you say is achievable only if another system external to the model takes some tagged model output, makes computations or lookups, and feeds the results back to the model in the form of text input.
Then it's game on for the model to trigger some form of code execution through this external system and escape the jail...