Babies' intestines may need time to adjust to solids. I know it's so sad that they (and you parents) can't sleep well because of this. Stop the food you think may contribute to their constipation for a while.
When we first started BLW, we only gave banana after DS had just pooed! But the rice cake (which causes constipation to many babies) is always his favourite and is friendly to his guts. I guess babies are all different.
Have you tried prune juice (1:3)? If it doesn't work, a very good nutritious natural laxative is flax oil. One teaspoon (spread in porridge or others) can make DS who usually poos every 10 days (but he is not constipated) pooled in 24 hrs.
We limit water to a sippy cup because DS is still breastfed quite frequently. We don't want "plenty of water" to decrease his appetite for bm.
The food we offer to him also includes some fiber (e.g. broccoli, whole grain cereal, fruits with skin) (but limit fiber for younger babies). We also give him "p" fruits regularly.