It's not that the order of the properties that matters. Let's look at this line for a second:
new Item(newItem.Properties().group(gobber2)).setRegistryName(location("gobber2_goo")).food(FoodList.gooFood)
If I space it out a bit so we can read it a little more easily (you can keep spacing as it was in the actual code):
new Item(
// start constructing item properties
new Item.Properties().group(gobber2)
// finish constructing item properties
).setRegistryName(location("gobber2_goo")).food(FoodList.gooFood)
that middle line is creating the Properties object. You were calling the food method on the Item object. You're right that food is a thing in Item, but it's just a variable not a method. As it happens, all the Properties::food method does is tell the Properties object to put your Food into that field, as you can see in the Item constructor you posted.
Comparing to your working one:
new Item(
// start constructing item properties
new Item.Properties().food(FoodList.gooFood).group(gobber2)
// finish constructing item properties
).setRegistryName(location("gobber2_goo"))
Now you're (correctly) calling the food method on the Item.Properties object. The only actual difference from your working one is the placement of a single bracket, which is determining what object you're calling the methods on. Changing the order works fine, you can apply properties to the Item.Properties object in whatever order you like (each method returns the Item.Properties object allowing you to "chain" the method calls like you have here). For example, this would also work:
new Item(
// start constructing item properties
new Item.Properties().group(gobber2).food(FoodList.gooFood)
// finish constructing item properties
).setRegistryName(location("gobber2_goo"))
If you had more changes to properties, like rarity or max stack size, you could put them in there too in any order. Hopefully understanding this will help clear up future problems.
Also, if you click the button that looks like < > at the top of your editor when you're posting, you can post code in the style that I'm using here, which will make your post look a lot cleaner.