The different account is the entire scam, and it is the detail that tells you everything.
The money that arrived is very often stolen — taken from a compromised account, or pushed through by someone who will later report the payment as fraudulent. When that report lands, the sending bank reverses or recalls the original payment and it comes straight back out of your account.
If you had returned it to the same account it came from, you would be square: money in, money out, and the reversal takes back what is already gone. By sending it somewhere else, you have made two separate transactions. The reversal still removes the incoming money, and your outgoing payment to the third account is gone for good. You are down the full amount, and you moved criminal proceeds on their behalf.
That is why they need it to be a different account, and it is why a genuine mistaken payment never asks for that.