Maybe not sales-wise - albeit they went from selling three times the combined number of their rivals' consoles in the previous generation to spending roughly three-quarters of the generation in third place - but the console's obscene R&D costs put a major financial drain on the company. They would probably have needed PS2-type numbers to turn a profit from the project, and they fell a long way short.
I think you are right, the R&D costs must have been really huge. I remember back in the early 2000's all the news regarding the joint development of Cell with IBM. They sure did a lot of marketing, stating that this would be the 'ultimate' chip, and that it would be incorporated in so many devices rather than only in PS3. The were shooting for the.... sun.
Thankfully they have learnt with their mistakes, and PS4 has been handled very very well.