it happens with fork coins. to know how it happens you first need some background.
in blockchain technology based on bitcoin (both of these altcoins are copies of bitcoin) your balance (or the coins you own) are in form of transaction outputs on the blockchain. so for example when you receive BCH you receive a transaction with a value attached which is recorded on the blockchain when it is mined (or confirmed). then when you want to spend your coins you sign a transaction that includes a reference to this transaction ID.
when a fork coin is created, they copy the entire blockchain so with that they are copying the whole history including your transaction which is in one of the blocks. so now your transaction exists on two different blockchains since it was duplicated. and since it is a copy, it copies everything including how transactions work,...
so now when you create a new transaction spending that tx that was copied the resulting transaction is valid on both chains if the cahins haven't put any kind of protection when they make their copy (which is the case here). any malicious person who runs both nodes can take transactions from one chain's memory pool and if they were valid it broadcasts them on the other network. this action is called replaying the transaction. and the protection against it is called replay protection.
it is hard to say why your other transactions didn't have the same issue. maybe no attacked picked them up to replay them on the other chain, or maybe you had included transaction outputs from blocks that were mined after the fork so the tx was invalid on the other chain.