My favorite video about the importance failure to learning was recorded by Jeri Ellsworth: Secret to Learning Electronics - Fail and Fail Often. It's not just about learning electronics, it's about learning.
I try to convince kids that failure is just feedback. Education experts from Dewey to Harvard conclude the same thing.
But if you ask a student (or about anyone) if they feel good about failing the answer would certainly be no.
We need to change the messaging about how learning happens - especially in school.