I am using Gnucash 3.4 on OSX 10.14.2. I am creating a new book and trying to set up the invoice counter to use I-%05li as the format under Preferences > Counters. If I enter the format, click Apply and switch to another tab and back, the new format appears as it should in the Invoice Number Format text field until I destroy the Preferences dialog. If I click OK I have the same behaviour - the field is cleared when I reopen the Preferences dialog. Saving the file after clicking OK makes no difference. The format string disappears. I have tested the other formats (vendor, bill, order, employee etc) and none save. Comparing the XML for the book with a previous one where this worked, it appears that the whole slot element and subelements for these strings is not being created.
Can you try again with version 3.5, just tried it on my Linux box and it is working.
I didn't see this message until now (2020) but I can confirm that if I create a new file and apply counters, they are working in 3.10.
OK, thanks for reporting back, will close this.