Deviation of the binary encounter electron energy from simple conservation laws in ion-atom and in ion-solid collisions