Per Jeremy Crawford on Twitter
"Is Freedom of Movement Broken? It doesn't seem to help a Grappled or
Restrained creature, at all. It this a mistake or working as intended?
if your speed is 0, how do you expend 5 feet of movement?" -Keith
"Freedom of movement is an example of a feature (an exception) that
lets you circumvent a general rule; it lets you spend 5 feet of
movement to escape a grapple, even though your speed is 0. Magic!"
There was a follow up question to this:
"So under freedom of movement, a creatures speed can be reduced to 0
(non-magically) but they are able to suspend 5ft to escape? So after
that, (if in init.) their speed would still be zero for that turn?"
"If you escaped the grapple, your speed isn’t 0 any longer." -Jeremy
With that question and answer, I guess it means that you can spend 5ft of movement, as many times as needed, to escape a grapple.
Per the spell:
The target can also spend 5 feet of movement to automatically escape
from nonmagical restraints, such as manacles or a creature that has it
This means that if you need to escape from 1 grapple you will have 25 movement (assuming 30 movement to start). If you need to escape from 4 grapples you will have 10 movement. If you need to escape from 6 grapples you will have 0 movement. And most importantly, if you need to escape from 7 or more grapples you will still have 0 movement (but you can still spend movement to escape from them).
When deciding if you want characters to be able to spend movement they don't have, keep in mind the rules for standing up from prone:
You can drop prone without using any of your speed. Standing up takes
more effort; doing so costs an amount of Movement equal to half your
speed. For example, if your speed is 30 feet, you must spend 15 feet
of Movement to stand up. You can’t stand up if you don’t have enough
Movement left or if your speed is 0.
This set of rules uses the term "costs" rather than "spends", but I could see how someone could say you can't spend something you don't have. The example even goes further to specify you can't spend movement if you have 0, or even if you have less than the "half your speed" amount left. So RAW, it seems like Freedom of Movement shouldn't allow you to spend movement you don't have. However, since it is specifically called out that you can use the spell to spend movement and get out of nonmagical restraints and grapples (and it is known that when grappled your movement drops to 0), I would say that the magic of the spell lets you spend movement you don't have. When you are out of the grapple you then have your original speed minus whatever you've spent to get out of the grapple.
Per the official SA Compendium:
The public statements of the D&D team, or anyone else at Wizards of
the Coast, are not official rulings; they are advice. Jeremy
Crawford’s tweets are often a preview of rulings that will appear here
I was not able to find any official ruling for Freedom of movement or the spending of move.