Emit a warning when attempting to unwrap a broken object raises an exception, for easier debugging (#5080).