The Israeli military says its troops mistakenly killed three Israeli hostages in Gaza after it erroneously identified them as a threat.