When it comes down to it, any game that offers any level of choice begins with "yes / no". Any game offering any level of choice is limited to certain pathways being gated open / closed based on the player's choice. And every game will always be ultimately linear to some degree. If I have 25 different endings, I still need to code a line to each one from beginning to end. (A computer can't make stuff up as it goes.) From the way you're insisting this is linear, I'm afraid you will never find a game in creation that is non-linear...and also offers a story. In order for there to be a story structure, there must be a beginning, middle, and end. If that arc doesn't exist, no story. Non-linear in a story-based game means different pathways to the end. If I create a sandbox game where the player can just do whatever, whenever...then there's absolutely 0% chance of having a narrative, detailed characters, motivations, and resolutions. A sandbox either has a linear "story mode" or it relies on emergent story-telling, as exists in games like Minecraft, Mount and Blade, or Rust.
A game offers you a fixed set of mechanisms with which you interact with the world. It may offer you some concrete goals – or it may not. Games like David Braben's
Elite, for example, don't set any goals; you just play as you choose. Games like Sid Meier's
Civilisation series set a concrete goal (world domination) but a wide variety of paths to reach it. In the best of the series,
Alpha Centauri, there are even several different types of victory.
In all these games the story emerges from the interaction between the player and the game world. Games like Meier's
Pirates offer you a selection of sub-goals as well as an overall goal, but you can complete as many or as few of those sub-goals as you like and still have an enjoyable experience – I've played that game for literally thousands of hours, and there are still bits of it I've never done because they don't appeal to me. On the other hand I have done 'conquer the entire Carribean for the Dutch', which is a goal I don't suppose Meier ever predicted, because I found it a challenge to see whether it could be done.
By contrast to these games, modern RPGs are highly scripted. Games like Horizon Zero Dawn and Red Dead Redemption, despite being open worlds, give you essentially one story in that world from which you cannot greatly diverge. You can't much affect the end-state (in the case of Red Dead Redemption 2, because it's a prequel, and the events of the game must necessarily leave the world in the state in which the first game found it).
Games in the BioWare tradition – which CD Projekt adopted and built on – still offer tightly scripted stories, but they are more complex with significant branching. The decisions the player makes significantly change the world, but only within the context of predetermined and pre-scripted endings.
But there is no need to have a 'coded line to each different ending', as you suggest. Part of the reason why, in the current state of the art, we mostly do, is because we now expect AAA games to be entirely voice acted. I'm hoping that with the emergence of
much more sophisticated text-to-speech systems (in combination with technologies like
JALI) we'll be able synthetically to generate persuasive speech, at which not only will much deeper dialogue trees become possible (as they were in
Neverwinter Nights, for example), but also procedurally generated dialogue.
So I believe that it is now possible to build a game which has the near-realistic explorable world of games like Witcher III, Cyberpunk, or Red Dead Redemption, as well as having very rich interaction (conversations, dialogue, friendship and loyalty webs) with all NPCs. The challenge then is how to tell stories in such worlds.
To make that happen, we need to give the game system tools to dynamically generate interesting opportunities for action around the player as they move through the world, and further mechanisms to chain together those opportunities for action into persuasive and compelling stories. I believe all this can be done with the technology we have now; I'm
working on it. I'm sure that many more energetic and talented people are, too.
So no: to have 25, or 25,000 different endings you don't have to script every one of them. You don't now. We do know how to script games with multiple different endings and we do have confidence that we can create satisfying stories in this way. But we're getting to the point at which we can create sandbox worlds which contain as rich (or richer) character interaction as the best modern RPGs, and I have confidence that we can make satisfying stories in such worlds.
However, Cyberpunk is not such a game and didn't try to be; and you'd be very brave, just now, to try to produce an AAA game that did try to be. They will come, and I look forward to them, but they're not here yet.