When she legitimised Gendry, Daenerys had not won the Iron Throne.
She died before her coronation
and Gendry was at the Great Council before
Bran was crowned King.
How was Gendry able to become Lord of Storm's End?
When she legitimised Gendry, Daenerys had not won the Iron Throne.
She died before her coronation
and Gendry was at the Great Council before
Bran was crowned King.
How was Gendry able to become Lord of Storm's End?
Because she was Queen of the Seven Kingdoms under those that follow her. Those that were following Dany's claim and trying to dethrone Cersei acknowledged the claim. Those on Cersei's side probably didn't even know about it and if they did I doubt they would have recognised it as true, after all Cersei is the rightful queen not Dany, right?
In either case it doesn't matter, Daenerys won the war and became Queen of the Seven Kingdoms, it does not matter that she never made it to the coronation. Once she was queen she could pass it through as law and fact.
And anyway, those on the Great Council are also those that would support Gendry as a Baratheon and his claim to Storm's End, there would be nothing to gain really by questioning it. In fact it would only likely turn people against you rather than with you.
Lastly, it is quite convenient and fills a gap that people were unsure of what to do about. No one knew who was Lord of Storm's End and having a Baratheon, even a bastard born one, take the Lordship is the best option to appease those in the Stormlands as they wouldn't want some outsider taking the seat.
As far as Targaryen loyalists are concerned, Daenerys was the rightful and trueborn Queen of the Andals, the Rhoynar and the Firstmen by birthright, she didn't need to sit on the throne to be that. She became Princess of Dragonstone (Heir apparent) the moment she was born and became the head of the Targaryen dynasty and the Queen when her brother Viserys third of his name died. Of course, by primogeniture, the de-facto law of Targaryen inheritance, Jon was the King by birthright. But Jon didn't know that, nobody did, so in absence of a male claimant, Daenerys claimed that right by both primogeniture and proximity.
Later, Jon Snow had sworn fealty to Daenerys so even that obstacle was removed from her path. She was well within her rights when she legitimised Gendry. At least as far as Targaryen loyalists are concerned, which at that time, Gendry was. All the people who assembled at the Great Council were effectively Targaryen sworn bannermen at that point.
Indeed it doesn't make much sense, but it all boils down history being written by the winners.
While the crown is being contested between Daenerys and Cersei, all who are appointed to titles can only count on keeping them as long as their side win and the winner is crowned Queen by the High Septon and sits on the Iron Throne.
So when Gendry accepted, it means he was betting his life on Daenerys winning the war. And she did, but there was never enough time after the battle to formally crown her. She won't count as a Queen of The Seven Kingdoms unless those writing the history see it fit to include her. The same goes for Cersei.
Now as it happens, there's none to contest Gendry's claim and nobody has a reason to. He fought on the winning side.
You don’t need to be crowned to acquire the powers of a monarch — you become the monarch as soon as your predecessor dies. Daenerys was legally Queen of the Seven Kingdoms as soon as Viserys died back in season 1. The United Kingdom still had a head of state between 6 February 1952 (when George VI died) and 2 June 1953 (when Elizabeth II was crowned). The coronation is a formality, not the moment when you become the monarch.
As @PaulDWaite said in a comment on your question: "Power resides where men believe it resides" - and men do not believe it resides with some some nobody who walks down from the North. Not only would the lords of the Stormlands not recognize Gendry, they would not even be told about his claim. Hell, he wouldn't even been able to enter Storm's End, assuming the castellan and the guards are not asleep at their posts. They have absolutely no reason to entertain his delusions of grandeur.
In fact, even if Daenerys had not been assassinated she would have had trouble legitimizing Gendry. She has no proof except a bunch of Northmen and foreigners' say-so. I suppose she would be able to force Gendry down the Stormlanders' throats - with her hosts of foreign fighters - but "legitimacy through arms" takes a few generations to stick. Just think back to the rebellions during Aenys I's reign.
This is yet another example of ridiculously poor writing on the show - the end point of several years of deterioration in quality.