How do i make the object at the end of my raycast not phase into a wall?

Its very hard to explain, but here are some pictures of what I mean:

You can simply get your object bounds and create it on the right position;
something like this :

   GameObject go = new GameObject();
    go.transform.position = new vector3(hit.point.x - bounds.x * 0.5f , hit.point.y - bounds.y * 0.5f ,hit.point.z - bounds.z * 0.5f);

I didn’t want to give you the full solution , i just wanted to give you the idea .
This is also another idea :
you can find the direction and then put your circle object back by its radius.

correctPoint = Hitpoint - (directionVector.normalized * radius);

Or if you have a ray

correctPoint = ray.GetPoint(hitPoint - startPoint - radius);

As you can see in your images you need the object to be placed against the wall, but with an offset equal to half of the object’s size or radius.

So the object’s transform would be something like this:

transform.position = hit.point - new Vector3(0f,objectRadius/2f,0f);

You’d have to put the “objectRadius/2f” part in whichever part of the Vector3 is the axis you need.
That should be enough for your example image, however if your game has other surfaces that use this mechanic (Ceilings and Floors for example) then you’ll need to look into Normals.