Oh dear that does sound like an unsettled night.
Solids can cause gas anyway but if you notice a significant increase or pain related to gas like you did last night then I'd look at what foods he had and at what time in the day. Eating earlier in the day can give more opportunity for the gas to come out before night sleep and they are moving a bit more too to get the gas moving. It might not be rice or milk causing this gas but if they are both quite new foods then maybe.
Have you tried some cycling and leg exercise to help the gas through? My DS was like bag pipes, I lay him on his back and gently lifted one leg up and held it and gas would come, then the other leg more gas would come, then both more would come. Gentle cycling of the legs then repeat the one leg at a a time and both legs...it prevented quite a lot of gas pain and was also quite amusing for me! also tummy rubs in a circular motion in a clockwise direction can help bring the gas or poo through.
Tomorrow I'll go back to just breakfast and maybe some white potato for lunch? What do you think?
If those are foods you feel safe with then yes.
One thing I'll add is that some LOs are fine with a food so long as it is not repeated too frequently. I didn't do the 4 days trial thing with DS (mainly because it is not needed these days if there are no allergies in the family) but later I realised that had I done 4 days of certain foods he would have been quite poorly. An example - carrots made his poo harder, a single portion he would be okay, but better if balanced with a prune, had he had carrots every day for 4 days (and not served prunes at the same time, lets say if I had not reached prunes on my trial list yet) he would have been horribly constipated. We've never needed to avoid carrots (not more than say selecting a different veg one day) but rather I always made sure they were balanced. It was actually quite helpful to know this in the end as I could naturally firm up his poo with carrot and loosen it with prunes so other foods might have had a similar effect but we avoided any of those problems.
Keeping a food diary might help. Although I did not do food trials I did keep a diary of what foods he ate so that if there were any problems arise I could look back for clues.