If I were to fail, imagine how disappointed my parents would be.
Literal
By-chance I [subject-が] fail-[conditional-ば], parents [subject-が] how-much will-be-disappointed thing-[-だろう].
どんなに…ことだろう ('how X it would be') is a dramatic rhetorical construction expressing intense imagined emotion. どんなに intensifies the adjective/adverb, and the final ことだろう ('it is a thing that... probably') adds exclamatory hedging. A literary/emotive pattern.