Problems switching from RayCast to SphereCast

I was trying to know if an object is grounded or not and I was using RayCast to do it:-
float minimum_distance_from_ground = 0.1f;
Ray ray = new Ray(transform.position, Vector3.down);
RaycastHit hit_info;

bool hashit = Physics.Raycast(ray, out hit_info, transform.localScale.x + minimum_distance_from_ground);

print(hashit);

It prints true when it is supposed to, but it hat issues so I decided to switch to SphereCast:-

float minimum_distance_from_ground = 0.1f;
Ray ray = new Ray(transform.position, Vector3.down);
RaycastHit hit_info;

bool hashit = Physics.Raycast(ray, out hit_info, transform.localScale.x + minimum_distance_from_ground);

print(hashit);

But now it isn’t working.
Can someone point out where the issue is?

A spherecast starts at the point you give + the radius of the sphere. If the sphere has a radius of 0.3, starts at your base and goes down, then the tip of the sphere starts 0.3 below you. If that’s partly inside the ground, it won’t detect anything (that’s a special rule – raycasts ignore things they start inside of. That’s so you can start a raycast from inside yourself).

To test, pull your object far up from the ground. The spherecast should work until you get near again. The fix is to “pull back” the starting point. In your case, maybe transform.position+Vector3.up*scRadius.