It is highly unlikely the noise of fireworks scared the hog to death. Being cuddled by a human predator may well have contributed though!!
We have to remember hogs are wild animals, not pets. They do not think of us as their rescuers, they are terrified of us and all handling of them should be kept to an absolute minimum
However it almost certainly died of whatever parasites had been found. When hogs are found they are nearly always in an advanced stage of illness
I keep seeing posts about hogs being scared of noises, but they live in proximity to us and are getting used to us and the noises we make