I see it may not be straightforward, but if I may still make a non-
urgent suggestion for future consideration:
1. Check whether it's a normal looking, unambiguous fieldname.
2. If true, and a label exists, then use the label.
After all, if there are any problems with column headers, we could
still set them manually as at present. I'm just trying to make things
easier for the most common case, a standard field column which may
have a label.
Best wishes, David