The operation of electricity grids is changing with the addition of more solar PV (PV) systems. Renewables can also play their part in the sustainable energy transition but also have drawbacks such as variable energy supply, net-load ramping and balancing challenges. This paper explores the flexibility and resilience of the grid in light of the blackout that occurred in Spain on 28 April 2025. The research adopts machine learning framework based on electricity demand, solar PV generation and weather data for the period from 2021 to 2025, which include forecasting, stress assessment, and anomaly detection. Short-term forecasts were done using LightGBM models and FSI was developed to calculate operational stress due to renewables. The results indicate that the operational stress accumulated slowly prior to the blackout, primarily from the high PV levels and high net-load changes. The framework was able to see abnormal grid behaviour and the early signs of stress. This research highlights the growing significance of predictive monitoring, and flexibility management to maintain the resilience of electricity systems with a high share of renewables.