When you close a valve the sudden stopping of this water sets up a shock wave where no place for this shock wave to dissipate so the relief valve takes the hit and odes its job.
Now you didn’t say what type of expansion tank you have so what ever it is have the air space replenished or replace this tank.