As of now, there is no method at present for controlling CapSize using line plot. You can write your custom code only to make caps using line plot. However, you can use
errorbar(x,y,err,'.','CapSize',x);
where x is the size of Cap you want. This way your plot would look identical except for a small ‘.’ Dot marker in the center of each line. I have implemented your code in MATLAB 2019a on Windows PC and zooming in and out enlarges and decrease the size of Cap as expected.