Hi there.
I didn't have problems with pear and night poo but my LO did kind of vomit with pear, it caused him a bad reflux flair up (he was on meds for silent reflux but could have flair ups with a few things). I was quite surprised as pear is one of the food that are considered gentle on the tummy but yk anyone can react to anything.
I would stop pear for a couple of weeks, let his gut calm down and then perhaps try again at a time when you know nothing else is going to be in question. This reaction may be pear or it may be the start of an illness which is coming on.
Introducing solids certainly can effect bowl movements and can cause night disturbances. Many people like to begin with breakfast or lunch to give LO time to digest during the day and for any reactions to happen before night time.
I'm just going to move your thread over to food allergies as there may be more experienced eyes over there.