One possibility that comes to mind is the compensator. The stock part has a relatively weak spring pack and very limited travel, so it tends to bottom out easily. If the spring tension has decreased due to fatigue, or if the bolt has loosened, you could be getting a bottoming out of the compensator cam.
I mention the compensator rather than the rear wheel sprocket (IDS), which can also give you a clunk when the rubber biscuits wear out, because you mention hearing it when you shut the engine down. I assume you do that in neutral, so that situation wouldn't involve the IDS.
Can you make the bike do this when you want? If so, take it to the dealer and show them. I suggest you get them to agree that they hear the same thing before you leave the bike, so you don't come back to pick it up after a few days only to be told that they couldn't find a noise.
Jerry