If something is someone's undoing, it is the cause of their failure.
downfall
His lack of experience may prove to be his undoing.
缺乏经验可能就是他失败的原因。