Hmm, I thought I'd try this coldet, because I have trouble with collisions myself. It looks nice.
The order in which you are checking the collisions is reverse. The returned normals are from the sphere, not the cube.
The order in which you are checking the collisions is reverse. The returned normals are from the sphere, not the cube.