I had very funny problems with sphere functions. Honestly, I set it up to search entities in radius of 128 units from player's origin. Then I calculated distance from found entity. In most cases, it was below 128 but in some, it found entities even further (much further).