You can force ChatGPT to write music if you get it to write LilyPond code. You need to avoid saying "write me music/melody" as it seems programmed to reject those prompts. Here's the sheet music, and a rendition of the second one.