You always get an Action before it ends. I often see PCs Rage out of combat just to get Advantage on an Athletics check to break a door, bend bars etc. Of course it then ends. So what?
The game mechanics have each actor taking turns, but the mechanics are simulating constant, simultaneous action.
You don't frantically do stuff, stand still for six seconds while everyone else does their stuff, then they stand still while you do your stuff.
Similarly, on your turn you have an action and a possible bonus action, and you can take them in any order (although some bonus actions may have timing restrictions
vis a vis the action, like TWF).
So imagine you want to do these things in sequence, as quickly as you can: cast a spell, begin raging, and attack. A perfectly sound sequence. You can cast spells when not raging but lose the ability to cast while you are raging, and you want to attack as soon as you can after raging so that your Rage doesn't end early.
In the narrative you are: casting->Raging->attacking, in sequence, as quickly as you can, without interruption.
In the structure of the combat rounds you are still doing those same things in the same order as quickly as you can.
It could be done in two ways: round 1, action to cast. Round 2, bonus action to Rage, action to attack.
OR it could be: round 1, action to cast, bonus action to Rage. Round 2, action to attack.
These are the same actions in the same order without any interruption. It is absurd to interpret the wording of Rage such that it ends early in one example but not the other, because they are the exact same sequence of events!
Sure, they could tighten up the wording, but if you interpret that wording to mean that in the second example the Rage ends the very moment it begins then you are choosing to interpret it in an absurd way when you could just as easily interpret it in the intended way: the Rage ends early if the Rage has been going on too long without you attacking or taking damage. It doesn't end the moment it begins because of the meta game of creatures taking turns.