DSmash does not have bad ending lag, the problem with it is that it loses a lot of power as the attack draws to its end, and if an enemy shields it Sonic is open to counterattack... however it does have some counter-mechanism for preventing said punishment... For one, the attack has a lot of shield pushback, even moreso if you charge it... and it's release from a charge is very fast, so even if they spotdodge it they are guaranteed to at least take the weak hit from the attack best case scenario. While it won't kill, it will send like 2-3 Bowsers away from you, which is enough to give you breathing room. If the attack is shielded they're going to need a quick and long ranged attack before you kick in the IASA frames/are able to safely punished.
Allow me to elaborate, assuming you hit the opponent with the weaker parts of the hitbox, you are nearing the end of the duration of the move, and shield pushback does have some lag before an opponent , so considering all the time it takes them just to act and react... you (might) be safe. Now if you hit with the earlier parts of the hitbox, while I think it poses much more risk, it still has some defensive rewards, as I said, it has a lot of shield pushback... and uhm... err... how do I put it...? I guess you could say thatwith the pushback and shieldstun considered, it leaves you somewhat safe, but still leaves you open enough for something like Ike's DA to punish you... well, I did say how the ladder hitbox is safer than the former/earlier parts of it, but it's still better than say Bowser's DSmash, eh?
Have you tried using it against airborne opponents? It's the same thing as trying to spotdodge the attack, which is why I love it for that situations.
With all that said, it is still to be used sparingly, much like any other of Sonic's kill moves. I don't think even good MK's spam their DSmash, and the reason DSmash only works is because people can't punish it correctly, but when you play/main Sonic you tend to learn some core game mechanics...