sounds like a thing called over run. our old fiat panda use to do it. give it a good long run and it will clear it out.
it is caused by carbon build up in the cylinder head. when the engine is running the carbon gets really hot, so when you turn the engine off the hot carbon keeps the engine "running"
when we first got our panda it would run for quite some time before it stopped.
Lol. Just made me think of our old Austin Maestro. Over run on that lasted about a minute with some hilarious clanging and banging. Never did bother to fix it and it finally died from rust after 150thou.