tl;dr: I’ve yet to see ChatGPT or Bard produce working OH rules code. I’ve not messed with Codex but am not hopeful. These LLM AIs are trained on what ever’s out there on the Internet. The bulk of rules code for OH on the Internet are on this forum. And the bulk of those are examples of code that people need help with (i.e. not working).
Add to that that openHAB is niche much of the JavaScript it generates is going to be generic JavaScript or Node.js JavaScript which isn’t necessarily compatible with OH.
Finally, most of these LLM systems are trained on data downloaded from the Internet a couple of years ago. That’s ages in openHAB time and much of that code isn’t compatible with current openHAB.