Thomas Jones, writing about the Kazuo Ishiguro novel Klara and the Sun, says:
Ishiguro doesn’t get tangled up in the complexities of neural networks, machine learning, algorithms or the difficulties of getting computers to understand symbolic logic. But it doesn’t matter how Klara’s mind works, because she isn’t really a robot. She’s a much older form of artificial intelligence, a much older kind of artificial friend: she’s a fictional character. It may be inherently impossible to write a novel that openly poses such questions as whether robots can be said to have souls, or to be conscious, or capable of feeling love, or of inspiring and reciprocating sympathy in people. By making them characters in a story, you aren’t asking the question: you’ve already answered it.
It's an interesting argument, with many confirmatory examples: from The Golem, to Pygmalion, to Rossum's Universal Robots, to 2001: A Space Odyssey, to Do Androids Dream of Electric Sheep? (though not all of those are novels). One counter-example is enough to disprove the claim, and the origin of this counter-genre is also interesting: why hasn't it caught on?
So, what's the earliest novel including an artificial intelligence as a character, which poses the question of whether it has a soul (or so on), and answers it in the negative?
One of the closest attempts I can think of is Jo Walton's The Just City, where non-humanoid cleaning robots obviate the need for slaves in an (alternative) classical era city. They are minor background characters. But as (minor spoilers) they are revealed to not be that dumb, it ultimately confirms Jones' assertion.