It has absolutely happened to me (and many others).
The thing to remember here is that, you are comparing ChatGPT - which is a fairly advanced tool, to a model that the tool uses.
Here are ways forward that worked for me:
- Change your model to the same ChatGPT model → chatgpt-4o-latest
- You have to prompt your API with more context, more instructions than what you would do with ChatGPT
- You could generate an output on ChatGPT, and then ask it to generate a reverse engineered prompt. Use this in your API prompt.
- Finally, you could also try using the API call twice, once to extract everything, and then another (say o3 mini) to reason and provide the output.
Hope this helps.