Hello.For defecation and contain feces is necessary a proper operation of muscles of the abdomen, perineum
It seems that some of those muscles not working properly.
I think that is necessary test to measure the pressure of the muscles and the state of the nerves innervating these muscles.
Go to your doctor to examine you and request ,probably,additional tests.
I wish you good health.
(In case the answer would have been useful please indicate this)