And it's all simulated. Last I heard, placing orders affects the market, especially if you're working with more than a toy account.
academics though, typically don't care as much about simulating for transaction costs because they're more interested in perceived mispricing in the marketplace as an interesting economic/intellectual phenomenae. Frequently academic papers will assume a 1-price world where the 1-price is midmarket and build the model off that.
If the market were indeed entirely efficient, then the described trade wouldn't be better than chance even with no transaction costs or bid-ask.