[ruby-core:118506] [Ruby master Bug#20605] PRs with backported fix for https://github.com/ruby/ruby/pull/11036 to Ruby 3.3 and 3.2