Macbook Air: shutdown on 50% battery
Judging from the symptoms I highly suspect it's an issue with the battery. I recently had my late 2013 Macbook Retina serviced because it experienced exactly the same issue: Immediate shutdown when the battery was drained to 60%. It would instantly turn back on if connected to power. My battery was 5 years old and had about 240 cycles. The apple engineer told me that the battery needs to be replaced because it was so old and coulndn't hold a charge.

What does the System Information (Click on Apple Logo while holding down option to access it) report about your battery?


Can you check what coconut battery reports about the remaining actual charge? It would be really interesting to see what the actual fully charged capacity of your battery is and the designed capacity. If it's less than 80% of the designed capacity when the battery is fully charged then I would recommend replacing the battery regardless of its cycle count.