...
If you say "Roy walks over and attacks the stinkin' vermin that shot Ftitz... " Roy has **not yet** attacked then and there simply because you said those words. There has been no Attack Action taken yet... Roy could be interrupted on his walk by a trapdoor that stops him 10' to the bottom and then Roy doesn't get there. Roy can then try any action he wants because he has not yet "taken" an attack action.
...
Roy isn't attacking and he, thus, isn't using his shove bonus action. He is moving, which the DM interrupts with a trapdoor, and allows Roy to try another action. But, Roy did take the Attack action. The DM intervened and stopped his intended action. Is that Roy's fault? No.
Suppose Roy was being attacked by a rottin' vermin. He declares his intention to attack the stinkin' vermin that shot Fritz. With the Shield Master feat, he first uses his Shove bonus action to push the rottin' vermin engaging him 5 feet back, allowing him to move without opportunity attack. He moves towards the stinkin' vermin and the DM says "Whoa, there partner! You got yerself a pit trap you just walked over! Better roll that Dex save to jump clear! Oops, ya failed slicker. Sorry, (rolls a die), that's 4 hit points of damage. Guess you won't be attack that stinkin' vermin after all."
"But wait!" says Roy. "I only used part of my move. I still have 20 feet left! Thanks to my Athletic feat, I can climb out without extra move, so I then have 10 feet left and I finish my move to attack that stinkin' vermin!"
"Hmm..." the DM ponders. "I reckon yer right, Roy. Ok, make your attack roll!"
The intent of the Shield Master feat is to allow you to make a Shove "attack" without having you use up an actual "attack" roll. Having it cost you a Bonus action is simply a way to represent that cost in terms of game time, preventing you from using your Bonus action for something else, like Second Wind.
At any rate, a round is only 6 seconds in 5E, so I make my players declare actions before rolling initiative (we roll every round, btw), and you can't change your action when your turn arrives (with certain exceptions like deciding to Dodge or Disengage) If you planned to attack, you can't suddenly switch to casting a spell since you weren't prepared to do it. If you are going to allow players to change actions when their turn arises, why not let them use a bonus action granted by a feat when they want during that turn???
And how would it be any different if Roy simply had two attacks and wanted to use one of those for the Shove attack? He still Shoves the rottin' vermin attacking him back, moves, falls into the pit, climbs out, finishes his move, and attacks the stinkin' vermin. No different except one uses the Bonus Action for the Shove and the other forces the player to utilize one attack granted by his Extra Attack feature.