It is good engineering practise not to use an electrical connection to serve as mechanical connection as well.
In my opinion, heat shrink does not provide a solid mechanical connection.
It does provide isolation when soldered to the switch and also provides a chance the cable will still be isolated when the solder connection breaks (i.e. when the cable comes loose with the heatshrink is still on the cable covering the bare copper wire(s)).
I think a better solution is to use hot glue between the lugs of the connector up to the outer sheath/jacket of both cables.
Another solution is a kind of (DIY made) strain release that is fixed to the switch andor to the panel which holds the switch, and fixates the cable (on its outer sheath/jacket).