You could use a 20k potentiometer if you want- it’s not correct but not detrimental to the VFD
the potentiometer would only control the speed from 0 to 5,000 ohms .
or about 1/4 of the potentiometers’ travel.
A 10,000 ohm potentiometer will have about 1/2 of its travel for speed control .
It all depends on how it is wired.
If just two wires, you are correct.
If all three connections are made, the pot is probably being measured ratio-metrically, and a 5K, 10K or 20K will probably work fine.
In ratio-metric mode, power and ground are applied to the end points of the pot and the wiper voltage is read by the circuit. The wiper voltage will be the same, no matter what the total pot resistance is, at the same wiper location. The current through the pot will change, but not the voltage.
To make a more concrete example, say the power supply is +10V. So there is 10V across the whole pot resistance. If the wiper is at the midpoint, the wiper voltage will be +5V, no matter if the pot is 1K, 5K, 10K, or 50K. You do want a pot that is close to the original, but don't sweat the actual resistance.