Judging from the images alone, the only thing wrong seems to be the presence of two locomotives in the lower image, when only one of them is possible given the (likely) constraints.
If indeed there are two front locomotives, which appears to be identical if the upper image actually shows one of them (not 0, as written) and the lower the other, then why? Perhaps the second locomotive is cheaper because it doesn't have a driver and therefore can only run behind a tail locomotive. If so, then the images are again correct.
But then there is the issue of restarting the game "fixing" things. Since the hiding is controlled by the leftmost checkbox (checked for everything visible, unchecked to filter out unsuitable vehicles), and since the state of this checkbox reverts to some default (for me checked, which it is not in the images), this might be why the vehicles become visible after restarting the game. If so, then this is not a bug, at least not as described.