Yes but the problem is you can't even get an attack with advantage through Hide, if you rule like that. This is also stated in the post. You have to walk out of the cover in order to make the attack. Hiding behinde a 3/4 Cover will not be working at all, since 3/4 Cover won't be blocking your enemies sight completely, which makes you spotted instantly after you took the Hide.
I think this kind of ruling is just overinterpretation which makes the rule total useless. I don't think designers would want Melee Attack after Hiding impossible. This is much more absurd and counterintuitive designing that leads to scenarios even more unrealistic.
If they had kept the wording that if you do something to break the invisible condition, you nonetheless retain it until the end of your turn, that would fix one problem - breaking cover to attack - but would give advantage on all your attacks that turn.
Specific wording that if you end your turn without cover or concealment then you are no longer invisible doesn't cover the scenario of the distracted guard.
They just need a paragraph on adjudication of when it's possible to detect someone.
If someone has the invisible condition and stays put, perhaps waiting for nightfall. I see no reason not to let them stay invisible. So a PC with a high passive perception walks into a room with hidden goblin guards, the guards do not instantly lose the condition on that PC's turn if they rolled over 15. The PC has to actively search.
If they move from their position, crossing open ground, an alert guard gets to roll perception, a distracted guard you check against passive perception, and in some circumstances (alert guards looking in the correct direction when there is no cover or concealment) the condition breaks because it is certain that the guard 'can somehow see you'. The latter is where you use classic distraction techniques as your action/free interaction to remove the certainty (thrown rock, noisy familiar etc).
Under cover or concealment e.g in fog or at night, if the rogue was moving silently at half speed, I might not even give the lazy guard their passive perception check because nothing has happened to break the invisible condition but that's me considering a personal preference. At night, they would take -5 on the check anyway, I guess?
The DM decides when a new stealth roll is needed. Perhaps avoiding lots of dry twigs might require a check when moving across open ground but that could easily be deemed part of the passive perception check since the PC has broken cover?