rmse produces warning, but doesn't fail when the observation and prediction vectors are different lengths. It should fail, this is misleading.
rmse(1:10, 5:15)
[1] 5.688905
Warning message:
In obs - pred :
longer object length is not a multiple of shorter object length
rmseByYear has specific requirements about columns. Check these near the top of the function.