There would be no way to ascertain the actual reason for Bailey's passing unless they had an autopsy done. There could be many reasons. I am guessing that either he did ingest or inhale too much of the pool water and may have had an alergic reaction to the chemicals, or he may have had some underlying medical condition that made his system become over-taxed by the shock of being in the pool.
Accidents happen. It is hard not to be paranoid when you have a small dog, but you need to take life as it comes. All live things were meant to pass. It was Bailey's time.