Need to leave war group before changing alliance. You can go back enter def and then leave group. Then you can change alliance. Just checked.