I saw the description for this module in a pamphlet a couple years before 3E came out, but I've forgotten the title. I seem to recall the goal was to spring someone from this prison but it's been so long I'm not sure- I do know it was described among other Greyhawk adventures, but I'm unsure if the prison was beneath the city Greyhawk itself or somewhere else in Oerth, sometimes referred to as the 'World of Greyhawk'.
I think it's WGR6 The city of skulls.
It could be:
The first edition module The Temple of Elemental Evil (1985) a continuation of (and which included) The Village of Homlet (1979). This was released as a reasonably accurate if buggy video game in 2003 using 3rd edition mechanics. It features:
The demoness Zuggtmoy is imprisoned there
The 2nd edition Greyhawk Ruins (1990) which was updated to 3rd edition in Expedition to the Ruins of Greyhawk (2007). Castle Greyhawk was the original mega dungeon of Gary Gygax's home campaign and has always involved player characters imprisoning and releasing (often accidentally) deities. Notable residents have included:
Fraz-Urb’luu, a demon lord, plus the demigods Iuz, Merikka, Rudd and Wastri. Traditionally 9 demigods were said to be held, the remaining 5 have not been canonically identified.