I am having troubles visualizing the mounting as you describe it,
Generally these switches just push into a rectangular hole punched through a frame member or bracket bent off the frame member
The aftermarket ones I buy are better than a lot of the factory items as the flange area is bigger.
However the universal "fix" is a self tapping screw inserted into the plunger to extend its length
Down here we are metric & I use a 2 mm x 16 mm self tapper and if necessary a rubber O ring under neath if it stick out a long way.
Usually just the length of the head does the job .
OR you can get the bolt on ones if there is some thing to bolt it on to
They look like this
https://www.gaspares.com.au/products/SWT6265?q=swt&product_code=SWT6265&per_page=&product_page=1&search[category_url]=
However you need to be careful because the NO & NC terminals can be transposed on some switches.
Most mower shops will carry a couple of every type .
And as it was obviously not the battery and the battery should have come with a 12 month warranty I would be having a few friendly words with your mower retailer followed directly to Husqvarna if you get no joy.
Also remember pick up & delivery ARE NOT COVERED BY WARRANTY and they could have actually charged less than the standard pick up & delivery fee.
From my service area to the city were all the mower shops are is a $ 90 to $ 120 ( Aus ) transport fee EACH WAY depending upon which shop you use.
All of them charge for warranty transport but a lot will discount it for paid for repairs & services.
Originally the switches were mostly mounted with nuts & bolts and one of the holes was slotted to allow for adjustments
But a push fit into a hole is a lot cheaper.