Does seem to be a duplicate of #1791, but this seems slightly better specced.
This only happens with a default formation. TBH, I'm not sure it needs to be fixed in general - orders like "gather" don't really make sense for formations, and it seems like that's the flaw in the first place.
Maybe only "walk" and related orders should have a default formation, and the others default too null.