the entire kingdom thought the king as mad as his onetime companions had thought him , the day an errant thought sent him into a market village in search of a remarkable horse , when he ordered that the beast be interred among the graves of all his royal forebears and the royal family gathered to mourn its passing .