Boeing may lose money on the $4 billion EMD contract (the only contract so far awarded), but it will make this back in spades on the full-rate production contract. If it were any other way, they would simply pull out.
Boeing may or may not make money later on. It depends on the contract. KC-46 is a high stakes gamble. Northrop Gumman pulled out early rather than accept the risk. Airbus accepted a lesser risk by bidding a higher price.
The A380 was a very high stakes gamble for Airbus. They may or may not make money on that gamble.
The 747-8 was a high stakes gamble for Boeing. They may or may not make money on that gamble.
The airplane business is not for the feint of heart. The
vast majority of airplane companies no longer even exist.