@andrew “Once isn’t going to destroy the bike”
I think if you contact the tech people at Honda, Yamaha, Ducati, etc., they might tell you otherwise. If the engine is under no load then it can easily overrev — unless there’s a rev limiter — in which case the valves can float, which in turn means possible valve damage, which in turn means a top-end overhaul. Maybe. So, no, the bike is not destroyed, but a top-end overhaul is not cheap on a fancy, high-performance DOHC engine.
“these bikes are made for high performance”
High performance involves a load on the engine, and is not at all the same as revving an unloaded engine. Your engine was designed to run at high revs with the bike at high (ground) speed, not sitting in your garage. Even on a dyno, the engine is under a load, not running freely.
So, are you screwed? Time will tell. You many never notice the damage, and maybe there was no damage. But if your engine needs a valve job at 10,000 miles you might ask your friend to pay for it. On the other hand, if you did not see the tach while all this was happening, you don’t really know how fast it was turning and maybe he never exceeded 4000 rpm, in which case maybe you’re in the clear. I sure hope so.