WordPress classes removed when using custom walker

I think the problem is caused by this line:

$classes = in_array( 'current-menu-item', $classes ) ? array( 'current-menu-item' ) : array(); 

It is either removing all classes except current-menu-item (if it’s found in the array) or removing all classes (otherwise).

Why this line is there? I think it’s for cases when you don’t want default classes to be added, except current-menu-item for current items, which is not your case. So just remove this line.