Hi Manpreet Kaur,
1. Peur is feminine and we just do not say - La peur des hauteurs
We say:
avoir le vertige /la peur du vide
2. Au sommet would be used more for a great height like a mountain or a hill.
En haut de is more suitable in this context.
But it’s best to accept these and just learn new expressions to build-up your vocabulary.
Bonne Continuation!