Probably the guys up front loaded their FMS wrongly. In my airline a stored flightplan from Athens to Amsterdam, for example, would require us to type ATHAMS01, or ATHAMS02 and so on. This is then inserted in the route INIT page. (the company route)
Now, if the guys up front were from Sweden, and don't know the difference between SVQ and SCQ, they could have typed:
BCNSCQ01 in stead of BCNSVQ01
which will take the airplane on the company route from Barcelona to Santiago...oops
The plane will go to the wrong airfield.
typical human mistake anyone can make. Luckily a mistake with a happy ending!