If you fail in public elective courses, you can make up for it in the following two ways:
1. Contact your failing teacher and ask him not to enter your grades into the system for the time being, then you can continue to take his public elective courses next semester, and he will give you credits after passing the exam (most of them do).
2. Don't worry about this public elective course at present, and apply to the Academic Affairs Office for one more public elective course next semester. Simply put, it is to use the credits of other public elective subjects to make up for the credits you lost in this subject.
CUHK teachers are generally very reasonable. Say something nice, it's no big problem.