Performance of hasmethod vs try-catch on MethodError

Since there is no return before cos(x), I would have thought the compiler could remove the entire try catch block. Why doesn’t that happen?