This just happened to me too. Gauss cannon cruisers successfully close to point-blank range. . . and then sit there and get destroyed without firing a shot. What's curious is that they worked just fine blowing through the enemy fleet at the jump point. Is it just random? Because that seems like it would be a just plain mean mechanic.
Well yes, technically it is 'random'. There is a delay between you issuing an order (such as 'Open fire!') and the ship carrying it out - assuming you ticked the 'Use Inexperienced Fleet penalties' box on the Game Info screen (the default setting is to do so). The good news is Task Force Training and/or Crew Experience can get that delay down to zero.