As much as your question may seem like reductio ad absurdum, it highlights the question of whether an automaton is capable of inventing and what it means to invent, just like the question of whether AI is actually "intelligent" and what AGI even means.
My opinion is that living beings like humans can invent; anything else (from simple calculator to sophisticated AI) is merely a tool that living beings can employ in their quest to invent.
There are three issues in play here.
One is the philosophical one, which you've addressed.
The second is the legal one. The laws of most jurisdictions are written so as to presuppose that a human is the inventor, because legislators imagined nothing else when the laws were written. Internationally, most of the decisions finding that AI can't be named as an inventor are based on assumptions built into the wording of the law, not on philosophy.
The third is the economic one. In due course legislators need to consider whether it's economically advantageous for society for AI to be capable of being named as an inventor or not. That's not happened yet.