What is Old is New Again:
SMALL FRAME CHALLENGE: A weapon that has the explosive explode at the point of firing is pretty much a suicide weapon with insanely short range, OR a mine of some kind. I wrote this answer before the clarification, assuming the shell would explode at the point of impact. I still think it is the only workable solution
A shaped charge creates a high-velocity hypersonic projectile as the explosion crushes a metallic lining into a missile that can penetrate a tiny target. The intense pressure doesn't necessarily liquify the metal, but it can get extremely hot and cause secondary incendiary effects. But a shaped charge begins to come apart after about 2 meters, making it an EXTREMELY short-ranged projectile. the most minute irregularities in the metal or explosive create wild instabilities in the projectile. This is the chief reason a shaped-charge gun doesn't work. Your gun has a range of two meters. Most likely, the shotgun would blow up and the range of such a small shaped charge would likely be shorter than the length of the barrel.
The second reason is that for every action there is an equal and opposite reaction. The explosion goes out the other way. This means the poor person or weapon behind the blast gets horrifically punished.
But there is a tried and true solution - set off the explosion at the destination, not the source. So a shotgun needs to launch a shaped charge to go off at the destination.
Someone has already made something equivalent, the FRAG-12. This very complicated shotgun shell is essentially a tiny version of a rocket-propelled grenade designed to penetrate light armor. Unfortunately, it's very expensive and competes with a lot of dedicated armor-piercing weapons on the military market.
It has a minimum range of three meters, so the explosive doesn't arm and explode too early, killing the shooter. The maximum range of this particular system is 200 meters, but a home-made, improvised device (even with some future tech added) is unlikely to reach these ranges without a rocket-assist.
But with the rocket assist, the sky is the limit - literally. The gyrojet was a rocket-propelled ammunition variant that would lend itself well to sci-fi Western. The guns are smoothbore, there is no significant recoil, the rounds could operate in space (or potentially under water), they look like ray guns, and they could easily leave glowing visible streaks in the air like a 'blaster.' It was available in a flare gun version, which was really a mini rocket launcher, but would support the kind of shells you are looking for. With a range of 460 meters, it was considered for development into a grenade launcher version that would look a lot like the weapon you are thinking of.
Here is a home-made version of a HESH round. The video is a bit underwhelming, but it does have a bigger kick than a regular shotgun shell. A similar round that is spectacular to see is the Dragon's Breath shell, a magnesium incendiary round.