There's nothing universal about applying a tool to any job. There are basics which may be universal, but application, suitability, etc. are guided by many variables.
There are 4 universal recommendations I have seen mentioned time and again about choosing the right home defense weapon:
#1 - Shotguns are the best weapon for home defense.
Long guns have more stopping power than a pistol (faster projectile coupled with greater accuracy).
The biggest benefit of shotguns is their ability to shoot shot, resulting in the spreading out of the shot. This allows a larger area to be hit with each trigger pull, reducing the requirement for precision shooting, and, depending on the type of ammunition and range, can cause greater damage than a single bullet from a handgun.
They require less skill to learn to shoot accurately.
They are much less complicated to operate.
They are not as picky with regard to the brand or type of ammo they can use reliably.
Pump action and break-open action shotguns are more reliable than semiauto handguns.
Shot shells are relatively cheaper and more available right now than many pistol ammo calibers.
#2 - If choosing a pistol for HD, a revolver is a better choice than a semiauto.
For first time handgun owners, revolvers are probably the better choice.
The design is simple, and the use is even simpler.
Revolvers can be operated more easily and safely than a semi (e.g. clearing the weapon for cleaning).
The more complicated design of pistols creates more opportunities for the failure of one or more components to disable it Requires extra training and practice to ensure the steps to clear a stoppage and return the firearm to working order can be performed instinctively. By comparison, this makes the revolver more reliable in a HD situation.
#3 - For more experienced users, or users willing to take a formal instruction, a semi-automatic handgun may make more sense due to their increased capacity and easier follow-up shots.
Full-size frame handguns are recommended for HD, having a barrel length 4"-6.5". Easier to control than compact handguns (better accuracy and follow ups in an HD situation), less felt muzzle flip & recoil due to larger size and weight, and normally easier for most to learn to shoot than a smaller pistol.
#4 - The best caliber to use in a handgun is the largest round you can routinely use accurately, can afford to buy for practice, and which satisfies any limitations or constraints you personally have, such as maximum number of rounds in the mags, weight being carried in your holster (if you also use the gun for open or concealed carry), how it fits your hand, the need to consider over-penetration, etc., etc. If this describes .22LR, then that's what you need to use.
Conclusions: For defense within the home, the shotgun is generally recognized by many to be a superior choice due to the close ranges and reduced likelihood of over-penetration. Not to mention, the sound of a shotgun being racked delivers the universal message that says "wrong house, go away".
As to the question of which pistol caliber is best, given the same shooter in the same situation with the same skills and experience, IT IS ALL RELATIVE, and it depends on the circumstances during the attack. The many variables which can make a small round a better choice can also make same round totally ineffective by comparison, given changes in those variables.
There are, of course, many "negatives" in addition to each of the above "positives." None of them, with regard to basic suitability and reliability, change the conclusions. The negatives go back to limitations, constraints, and suitability to a given set of circumstances.
This is not my opinion, but a collection of several source's opinions and recommendations I've read over the last 8 months. Hopefully something here will add to the discussion at hand!
Aloha!