I've kept Dynastes granti adults, and they would try to fly in the enclosure, I don't recall what time of day they'd do it, seems like it was during the day,
I've kept Prionid adults and they would try to fly after dark in an enclosure.
Hard to have an enclosure big enough for a beetle to get going, unless they're small, like fireflies.
I've read somewhere children in Africa would tie a string to a goliathus and let it fly around , like one of those airplanes on a string-
I don't have any experience with that, but may be able to get back to you sometime. Watching beetles fly is a great fascination.
What usually ends up flying in my house are butterflies and moths, and they can be difficult to retrieve or relocate. Setting up a uv light
on the floor didn't work-