You may travel by plane to another country, as long as the territory in which you reside is not confined or restricted. In that case, you will not be able to go abroad or to another part of Spain, except for justified exceptions. On the other hand, it is advisable to check in advance if the destination country has imposed entry limitations.
You have two options:
1) under your responsibility to make the trip and expose yourself to being stopped by the state security forces at a control and sanctioned, if it is not for just cause the trip (between 600 and 300,000 euros)
2) change for free, if your airline allows it, the date of the flight since most of them allow free changes up to a year after the original date.
That is what I understand. See if someone can advise you with more certainty.
Edited: yesterday, 19:22