There is an issue with using the bounds of a BoxCollider2D outside of the fixed update loop.
From the tests I have done the bounds may not always be relative to the player position in the update loop. This means the raycasts which use the bounds position may return no collision when they should be.