I feel your frustration and it makes me so angry when drs will not 'listen' to parents.
My son suffered with constipation although tbh nothing like for 45 days. In his case he was so 'backed up' that despite being starving he physically couldn't eat more than a mouthful or two. He also had regular pain in abdomen. Dr gave him things like Gaviscon for heartburn(he must of been joking!!!!)
Eventually(after numerous visits) and me re-iterating concerns over height/weight, pain etc he conceeded and did some blood tests and for us that was all that was needed to get action. He was referred to consultant and things have gone well from there.
I think if a set of blood tests could be done that will show up no end of things-whether inflammatory markers are raised, whether he is anaemic, deficient in any other area etc. If this is the case then usually it would be followed by a 'visual' as in a colonoscopy(biopsies could be taken too) and/or barium follow through x-ray if they suspect blockages.
All I can really say is keep pushing and don't doubt yourself! You know your child far better than anyone else and if your gut instinct is telling you something is wrong keep pressing for answers.
Hopefully Risnights will be along soon, she will be able to give you more full on advice.
Hope you get a diagnosis(and correct treatment soon)