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