Obviously there is a B'rel retrofit right next to your ship trying to start a political conflict by letting it seem like you are fireing on friendly ships..
And a traitor who manipulates yor database. Probably a female vulcan that looks like she just escaped from sex and the city.
Scan for an enormous amount of neutron radiation to confirm that theorie...
Don't worry your not the only one, it happens to me as well occasionally since they brought the Tribble patch with the power tray update live a lil bit ago. File a bug report on it I guess and maybe they'll get to it, maybe...
Seems to happen most often when I uncloak. But can happen any time, of course when I uncloak tends to also be when I start cannon fire (But I don't usually want to fire a torp straight away).
I know this seems like a miniscule thing, but the following happened to me for a while... Make sure you're ALT key isn't sticking. I have Fire All Weapons set to SPACE with ALT+SPACE set to Fire All Torpedos and CTRL+SPACE set to Fire All Phasers. I went for days where all of a sudden, just for a little bit, my torpedoes would not fire. It started getting worse and worse to the point where I was going to file a bug report when it happened again.
So, then it did and I went for about 15 minutes in a fight unable to fire any torpedoes. A strange turn of luck happened, as my cat tried to jump on me onto the desk, landing on my keyboard. All of a sudden my cat fired my torpedoes!! Something clicked and I knew then it was my keyboard.. so checking it out in Notepad.. Come to find out, my L-ALT and L-Shift keys were sticking.. A good cleaning fixed that.
One too many moutain dew spills.
Even though, with the above comments, this appears to be a bug you've encountered. I'd just rule sticky keys out just to ensure you don't get embarrassed should it turn out to be that, after filing a bug report.