Hello.
I’m not familiar with the Madrid route so can’t comment on it. Longoño, Burgos and León on Camino Frances are 3-4hrs from Madrid on bus or train. According to www.gronze.com you could walk Logroño to Burgos in one week, or walk Burgos to Mansilla and then bus to León to get train/bus...