> I agree in principle. But doesn't that mean that to have correct behaviour, users of getLayerProperty need to wrap it in a try/catch block most of the time? (or call the existence function).

Calling an existence function would be my choice, because it makes the code more explicit and readable.