The release of Ruby 3.0.2 shipped changes to the CGI library, including (but not limited to) #4, changes that came from a JRuby contributor. However, Ruby 3.0.2 claims to be shipping the 0.2.0 released gem.
The gem needs to be updated and released.
JRuby only sources gem-based standard libraries from released gems, and when the released gem does not match what the Ruby version claims, we have no way to install the correct library.