You will need too apply a force (SetSpritePhysicsForce) to the sprite (ball) to make it move left or right on a flat surface.
The gravity is pulling straight down on flat surfaces without other forces, so you have to push it left or right on flat surfaces.
Don't forget to SetSpriteShape to a circle (1) so it can roll.
I use SetSpritePhysicsVelocity if I want a bounce too, when changing direction after hitting a side wall.
You can use a variable for the amount of force, and multiplying that by -1 would allow for a single force call to work both directions.
You would apply a positive value for the variable to roll until it hits a side wall, then multiply that by -1 when hitting the wall to make it a negative value to roll the other way.
Then when it hits a side wall rolling in that direction, it would again multiple the force variable by -1 to change it back to a positive and roll the other way.
I hope this explanation make sense, because I don't have a snippet to share.
Your image attachment doesn't seem to be here, so you may want to try uploading it again, or post a code snippet.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1