Both of your statements convey a similar meaning, but the first one "Doing something that potentially will fail" is more commonly used and considered more grammatically correct.
However, you can also rephrase your second statement to make it sound more natural, such as "Doing something that has the potential to fail." This phrasing still conveys the same meaning as your original statements, but it sounds more natural and is often used in everyday conversation.