My 12 gauge pump is my primary defense gun at home with my 9mm as second. I see no reason to change to a rifle even tho some will say the rifle has more range. The defense in self defense will need to be proven in a shooting and unless the threat is close that defense may not hold up in court. I was told this by my instructor when taking my permit test.
Your instructor did you a vast disservice. I say, being in the industry myself as a trainer. A 9mm fired at a 45ish degree angle can be deadly for about 2400 yards based off what Google tells me. Which is why we strongly discouraged "celebratory fire" when overseas ie firing into the air for holidays/celebrations. While self defense is (legally) limited to short range threats such as an intruder say within 50 yards, the weapon is unlikely to play a role. Can you shoot 50 yards with buckshot? I can, most others can. Rifle? Easy. Handgun, tougher but doable. But a 12ga is harder for others in the family who may not be as well versed in firearms. My personal philosophy that I share as being a trainer is: HD weapons should be easy to use by anyone capable. The Mrs who has had a few classes, maybe a teenager who has played a few video games to gain interest and done instruction with a parent. A shotgun will recoil harder than an AR. Doesn't matter what kind of ammo you use. Just does. A bad guy in your house or lawn dead within 50 yards is going to be just as dead whether you shot them with a pistol, shotgun, or AR. What matters is how good you are with each. And when it comes picking a weapon for HD, there are criteria to consider such as recoil, accuracy, capacity, and a few dozen others.
Here is John Lovell doing a similar breakdown of pistol vs shotgun vs AR.
As a trainer, when I do consults, I want to see what my student can do. If they handle a handgun well, I can develop that. If AR, same thing. Shotgun (rare but does happen) same thing. I don't have as many first time gun buyers any more. A lot of my business comes from referral. New shooter, buys a gun, needs help being familiar. That is where I see most work lately.
New shooters just don't do well with a shotgun. Between the recoil, pump manipulation (like short-stroking), safeties in different spots etc. I have seen new shooters get a shotgun based on bad advice and nearly give up owning firearms altogether because of recoil and poor hits at a range. But get an AR or a comfortable pistol, and all the results and attitudes change.
Now, I am not saying a shotgun is the worst choice. Or even a bad one. It just has limitations based on the advice I can and do give. There is bad advice out there that a shotgun is the best at home defense because you just point it in the direction and fire. Or just fire two blasts in the air...
The TLDR version is this. The choice of HD weapon between an AR pistol, handgun, or shotgun is not about range. Its about the criteria John talks about: recoil, handling etc. Your choice of firearm pick should be way down the list anyway. Teach and practice with your family. If the door gets kicked in or a window gets shattered from outside...do "this". Whatever your plan is. I recommend consolidate your family into a safe location, defend with a thought out HD weapon, and call 911. A trainer will impart knowledge on someone based off their own biases. A good trainer will take your strengths and make them better