What could b causing pain under right rib when bending over? When I stand straightup & stretch I can feel something move back into place then its fine

Rib cage. You could be experiencing benign instability of the rib-vertebra junction or rib-sternum junction. Somtimes inflammation of the joints where the rib meets your vertebra in the back or where the rib meets your breast bone (sternum) in the front can cause pain and a sense of the rib moving in and out of place. If symptoms persist see your doctor.
Floating Rib. Uncertain exactly what but this could be a floating rib, slippage of tendons, an unhealed fracture, etc when you see your physician an x-ray or other imaging may be necessary, .