Typically NPC dialogue also serves more than immersion, such as helping the player solve a quest or find a hidden thing. Some are for world building, too, but even that might be risky with AI since you may end up with inconsistencies that would actually be counter to immersion in the long run.
Like, you don’t get actors to ad lib whole scripts in a movie no matter how versed there are in the story.
Typically NPC dialogue also serves more than immersion, such as helping the player solve a quest or find a hidden thing. Some are for world building, too, but even that might be risky with AI since you may end up with inconsistencies that would actually be counter to immersion in the long run.
Like, you don’t get actors to ad lib whole scripts in a movie no matter how versed there are in the story.