I know those two cables are different lengths so that can be a problem .
Usually you can find some cable from another mower that you can slightly modify to fit.
There are a lot of different cables online to check ,you can cut your cable to use the end part and join it to a new cable if the new cable end is different. A U bolt or cable joiner can hold the old cable end on a new cable.
If you have oxy you can braze your old cable end on a new cable.
There are places that advertise online that make custom cables , one is called flexibledrive