The flattering ending is modern, and the popular attribution to Shakespeare is chronologically impossible.
The phrase assembled itself in stages. Jack of all trades appears in English in the early seventeenth century — it turns up in a 1618 sketch of a prison porter — and at that point it already carried a note of scorn, for someone who turned his hand to everything. The master of none added in the eighteenth century made the criticism explicit, which is when the expression acquired its sting.
The consoling final clause — but oftentimes better than a master of one — is not part of that history. It has no known source before recent decades and spread in the internet era, which makes it centuries younger than the phrase it claims to complete. It is frequently credited to Shakespeare, which is impossible in the plainest way: Shakespeare died in 1616, a century before master of none existed to be answered.
There is a simple test worth borrowing here. Whenever a full quote is attributed to Shakespeare, ask which play. His complete works are freely searchable online, so an unlocatable Shakespeare quotation takes about thirty seconds to disprove — and the fact that the source is never named is usually the answer.