You could check if it is touching the ground with colliders and if it's not you can make some kind of roll function. Just an idea!
What about raycast themselfs? If you have a 2x2x2 and in this case just to simplify. 5 raycast for each possible direction but -z since we are on a plane and want to check above. Lets say that all your raycast have a length of 1 on all faces. if they come in contact with something you know that this direction isnt an option and you could suggest valid path that have at least 1 unit available for your cube. Just another idea. Of course this is all very linear and i dont have your vision of the project.