> Waymo has certainly never been profitable
The employee needs to be profitable, not the aggregate of all the employees.
As for speculative research projects, nothing succeeds like success (making money). Researchers who produce loser after loser projects I expect would be much more likely to be fired than researchers who had a win big enough to cover their losing projects.
> possible
The whole field of cost accounting is devoted to figuring this out.
Back in the 70s, I attended Caltech when Feynman was on the staff. It came up in conversation that Feynman was making a salary of something like $55,000 (a lot of money in those days). I said what could anyone do to justify paying him such a salary. A grad student laughed and said "you don't understand. Feynman doesn't need to do anything to be worth that salary. He just has to be on the staff, which attracts donor money and draws top talent to Caltech."
Of course, he was right.
But also, Feynman being Feynman, did do an awful lot as well.
In many universities and companies, you'll find such "prestige" staff.