Hi - perhaps he is being bullied by other cats so is reluctant to go outside? I have had this happen in the past - it has always sorted itself out in time but if it persists I would take him to the vet just in case.
I have 4 cats and 2 dogs. They get on well together. The 13 year old cat went in to my daughter's bedroom while she was in there and just pooed under her desk for no reason. It wasn't diarrohea either.
Went to do the school run and came back an hour later to find another poo in the bathroom.
He has always gone outside so we don't have a litter tray in the house. There's been no changes either, so not really sure why he's done this.