I think you are working under a false premise when you say that:
A GFO can (relatively) effortlessly be identified by military.
Even today, military operations involving the combined forces of a single country, can create significant problems in this regard.
As a result, the UK Ministry of Defence even went to the extent of issuing a chart explaining rankings and the insignia worn by the different services when it became clear that junior officers were often confused by the insignia of rank used by other services (for instance, a Corporal of Horse in the Household Cavalry is actually a sergeant!).
You can probably imagine just how much more confusing it can be when military forces from multiple countries are working together!
To give some idea of the scale, taking “General and Flag Officers” (“GFO”) to be NATO rank-equivalent OF-7 and above, according to this Freedom of Information request, the UK military had 142 regular GFOs on 1 January 2015. According to a Congressional Research Service report, the United States had 891 active duty GFOs on 1 November 2018.
The numbers would have been significantly higher during the war. Nobody could have been expected to recognise all the GFOs active within the allied forces on sight.
Anyone who has served in the military will tell you that all armed forces have a rigid hierarchy. This hierarchy is important. More senior officers (should), in general, have a better grasp of the 'bigger picture' and broader strategic objectives.
So it is really important that junior officers and other ranks should be able to recognise a senior officer immediately. This is why badges of rank are routinely worn in the military.
This is also actually one practical function of the military salute.
For example, in the British Army, the salute recognises the Queen's commission awarded to officers, and seniority of rank. The junior rank salutes the senior rank, and the salute is returned. Having acknowledged the senior officer, the junior rank should be prepared to receive orders.
However, for this to work, the junior rank must first recognise the senior officer's rank! This is why badges of rank have tended to be prominently displayed (at least when not in forward operating positions).
Although the USMC doesn't have the Queen's commission, a similar principle applies there. In World War 2, this immediate recognition was the perceived 'noteworthy advantage to wearing a helmet with rank' for the US Army and Marine Corps.
(The other function of the military salute is, of course, to massage the egos of some senior officers)
Clearly, while useful for ensuring that friendly forces are able to immediately recognise senior officers, such readily identifiable badges of rank become a liability when close to the enemy (especially if the enemy is known to be employing snipers). They would usually be removed, or otherwise concealed, by senior officers visiting a forward position.
So, as to your question:
Wasn't Buckner foolish to wear a helmet with his rank anywhere near the enemy?
The answer is, perhaps he was.
However, bear in mind that Buckner is the only person who can't see his helmet. Presumably in this case he forgot to change it for one that didn't have his rank displayed on it, and nobody thought to remind him until the Marine outpost spotted it and sent a signal.