Rattle is definitely a vibrating heat shield, gear change revs will be of resonant frequency with the rattle.
Engine revving when coasting is due to the VSS picking up a reading of speed whilst the engine is reporting idle state to the ECU. Conflicting info hence it tries to rev. Simple solution to that is not to coast!