There are currently no direct trains because Spanish railways used COVID as an excuse to get rid of all remaining night trains in/from Spain. Portuguese railways still want to operate a night train to Spain (more specifically to Irún/Hendaye) and they're working on that but that will now happen this year.
There will probably a future high-speed day train between Madrid and Lisbon but again not this year. For the current train options, check this page.
Note: for Spanish timetables, use the RENFE website. RENFE (Spanish railways) only share some of their timetables with the rest of the world and therefore all planners, including the rail planner app, are very incomplete for Spain.