Why would you run into a room with a turret aimed down the corridor that you're entering from?
If you have issues with a Basion, send in a Genji, or swarm it with an Reinhardt so you get to free-fire on them for a few seconds (which will kill the Bastion, if your aim isn't atrocious).