Since you do not hold a valid travel document for Morocco I think you will be refused to board in Zurich but you should contact the airport about this matter.
Why do you not fly to Malaga (EU) and then take a two hour bus to Gibraltar?
You can travel this route for less than 100 euro easily..
I bet this will be cheaper and faster than first flying to Morocco and then with an intermediate stop onwards to Gibraltar.
Edit:
In addition you can contact the Moroccan Embassy to see if they accept your European Identity card as there are some countries that accept them even if there is no formal agreement between those countries. For Dutch this was the case with Morocco but this is now no longer the case.
Credit:stackoverflow.com‘
4 Mar, 2024
4 Mar, 2024