I have a 3 story 2 1/2 bath house (2 baths on 2nd floor, 1/2 bath on first). After flushing any of the toilets a loud thump occurs in the wall after the filling is completed. It also occurs infrequently at other times, but consistently after a toilet is flushed. I believe the thump is in the wall where the one vent goes, but don’t know if that’s significant.
Your symptoms are classic for WATERHAMMER, which is a loud banging sound when a fixture valve closes. It’s usually associated with faucets, but don’t forget that the ballcock valve in your toilet tank is a valve just like any other.
You could try doing what RP suggests, or you could install a water hammer arrestor on the line to the tank.