Just to clarify the magnets comment-I did not actually mean that seriously.
Probably 5 or 6 years ago, we had a regular here(RIP) who had a somewhat hacked together MDD with a lot of...questionable...upgrades. Until the Mac Pro came along, the MDD was the go-to box for a person wanting factory support for a lot of discrete hard drives. It has 4 IDE HDD bays, plus two optical bays so it's possible to put 6 HDDs in it(of course, these days, you can do a LOT better with SATA in a G5-your boot drive must be APM, which limits you to 1.9tb, but you can format a second drive as GUID and go as big as you want). There also comes a point with PPC Macs where you should seriously start looking at an Xserve RAID, which is often available with 14x 500gb drives, and initialized as two separate RAID 5s gives you I think 6gb of storage space(I have two, but have have yet to initialize either of them-I don't like the noise or amount of power). They are as fast as you can expect from ATA in RAID 5 given that they communicate with your computer via Fiberchannel, but I digress.
In any case, this particular guy decided that the built-in HDD bays in an MDD weren't enough, and wanted to fit I think two extra HDDs in an MDD case. He posted on here asking about using magnets to secure extra drives in the case. We all told him it was a horrible idea, although I don't know if he ever actually did it(knowing how he operated, he probably would have done it anyway given how bad of an idea we told him it was). That became a bit of a running joke for a while.
On a more serious note, this isn't DIRECTLY applicable, bit when I first set up my Mac Pro 1,1 at work back in 2015, I put a 256gb SSD in it as the boot drive. The "classic"(aka "chessegrater") Mac Pro has its SATA ports directly at the top of the LoBo, and is designed such that hard drives slide attach to sleds that slot into the case, line up correctly with the LoBo, and then are locked in place when the side panel is locked. The sleds are designed for 3.5" drives, and if you look at a 3.5" SATA drive you'll find that the SATA port is not perfectly centered on it. All common SATA SSDs are 2.5". The Mac Pro 4,1/5,1 offered SSDs from the factory, and there was a factory "adapter" sled designed to hold them. Unfortunately, although they look similar, those are just different enough to not fit the 1,1-3,1. I was too cheap at the time to buy one of the aftermarket 1,1 SSD mounting solutions, and since SSDs are small and light, I just shoved it into the SATA port and used a piece of the thick foam 3M double sided tape to secure it in place.
If I wanted to secure a hard drive on top of the ODD in a G5, I'd be inclined to try just that. The 3M foam tape is tough stuff, and I suspect a strip down each "rail" of the drive would hold it fine. Of course it would be a pain to remove, but should come off. Just be sure you remove the ODD first and clean off the ~15 years of accumulated dust. With as much air as the G5 cases move through them, there's generally a lot of dust all over the place.