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