Is the prayer valid if one does not know or forgets the Qunut supplication?
Yes. The prayer is valid even without the Qunut, because what is indispensable is Al-Fatiha. Without the Qunut, however, it is not complete in its beauty, so one should learn it.
A prayer has parts without which it cannot exist, and parts that make it complete in its beauty. Al-Fatiha belongs to the first kind. Without it no prayer is valid, as the hadith above shows. The Qunut, a supplication in the Witr prayer, belongs to the second kind.
Whoever forgets the Qunut in the Witr prayer cannot insert it afterwards. But the prayer remains valid and good. God does not burden anyone beyond their capacity, and forgetting is human.
This does not mean the Qunut can be left out at will. It is a very important and valuable supplication and a firm part of the established way of offering Witr. That is why children are taught it and asked to learn it by heart, almost as if it were obligatory.
An image helps to understand the difference. A person with only one eye is a complete person. He can do everything he was created to do, and no one would deny that. And yet something is missing from the beauty that belongs to a human face. It is the same with a prayer without the Qunut. It is accepted and complete, but not in its full beauty.
Children who do not yet know the Qunut need not worry that their prayer was in vain. It is simply a good occasion to learn it with them calmly.