Here is a thought on jetlag and Madrid. I am a great believer in the "stay up, early supper and bed" theory. However, in Spain there is no such thing as early supper. Restaurants open at 8 pm and that is early. (Actually, some restaurants in tourist areas will open earlier.) In your case, you can take your Palace tour, follow the little itinerary I sent you walking to the Plaza Mayor, down the steps of Arco de Cuchilleros and on to Mercado San Miguel for lunch. Then you could go to the hotel for a 2-hour siesta (set the alarm), go to the pool for a while, and then have dinner at 8 pm and back to the hotel. Then you will be on Spanish time. The next morning take an 11 or 12 o'clock train to Barcelona.
This method has worked for me. No guarantees for anyone else!
There are many good restaurants near you, like Taberna del Alabardero, Casa Gallega, Asador Real, etc. You also could go to Botín. https://botin.es/en/menu-botin-en/ You must reserve there. Their signature dish is roast suckling pig, but there is a lot more.