With a Lycoming or Continental engine at idle, briefly switching off both mags will do no harm, and is good practice in my experience. Any power while doing this may result in a damaging backfire in the exhaust, so idle only.
Your propeller bolts will be fine! Anything which "shock loads" your engine, you're going to feel as a shock in the fuselage, so you'll know it's happened. Careless pilots are doing more harm slamming in full power form idle, than could ever be caused by any power change in the idle power range....
I have too little experience with Rotax engines to offer a qualified comment for them. But, for any engine, a potentially damaging action/event will probably be mentioned in a flight manual limitation, or at least cautionary note. Are there any such for your aircraft?