You're right to take it as a learning experience! It's tough to be rejected, but focusing on the positive and using your preparation for future opportunities is the best approach. The fact that you were able to identify a specific area for improvement, like aligning your background more closely with the role, is a great sign that you can learn from this experience