How long are your rides? For rides around an hour to an hour and a half I can ride while fasting, even at the end of an 18 hour fast. The trick is to just work up to it.
(like you, he eats carbs when riding long distances--even with the aim of staying in ketosis)
I eat a lot of carbs ( mostly clean, veges and fruits ) and cook most of my food at home. I’ve been maintaining weight but haven’t really lost much fat.
I know my diet is the reason, so the answer is probably to reduce carbs and increase the proteins. Perhaps try for a longer intermittent fast.