Curve flattens when converted to 2D I have never had this problem before, and it only applies to this curve in specific.

Do you know what's going on?
In the Edit mode select all and Rotate in X axis.

Out of Edit mode. Click 2D

In the Fill select Both