It always worked in this way: they sell the console at least during its first years at a lost, and need to sell like a couple of games, or a couple of Plus/Gold years, for that console to compensate with their profits the loss of the console.
And since at the end of the generation they sell 8-12 games per console, with the indirect profit that every consoles generates with the games sold for it they end having an overall profit for each console.
So it doesn't matter if all consoles are sold at a loss.
If PS3 and the first Xbox console geneations generated an overall loss was because its costs on R&D, marketing, infrastructure costs with stuff like server costs, marketing stuff, exclusivity deals with 3rd party games, studio big acquisitions, several unprofitable expensive games and so on. The reason wasn't to sell their consoles at a loss.