If you didn’t have a water hammer problem before, and now you do, there may be something in the solenoid valve creating or allowing this to happen.
Any easy way to find out if it’s the solenoid valve (I am assuming that you’ve already had the solenoid valve checked) is to temporarily remove the solenoid valve and see if the water hammer problems go away. If the water hammer problem goes away, something in the solenoid valve, the valve installation configuration, etc., would appear to be the cause. If you haven’t had the solenoid valve checked yet, do that first.