[ruby-core:125323] [Ruby Bug#22007] Inconsistent type checking on rescue