Most likely, this is a truncated and somewhat reinterpreted version of an old proverb.
According to Dahl's dictionary, it originally sounded like 'ate the dog, only choked on the tail.' This was said about a person who overcame the main difficulties in some challenging task but made a regrettable mistake in the end and ultimately failed.
Later, the first part of the proverb began to be applied to a person who successfully handled a difficult task, and even later — to someone who possesses sufficient knowledge and experience in certain matters.