Hi Jah,
I think this is the default behaviour of export to excel when we have some data then it exports data with headers otherwise headers will be empty.
Logic:-
In the microflow check your retrieval list is empty or not in the decision
if list is not empty then follow export to excel logic but if list is empty then create one object and assign the value like this string(empty), int/dec(0),boolean(false) etc. then write export to excel logic for this object.
After exporting the data use delete object activity and delete this object.
By using this logic you have one row data with null/unused value now you will be able to see the headers after that delete the object.
Hope you like the answer.