I may not be able to come out with concise examples but i may interpret the exception under s.8 of the PC i.e " unless the knowledge of the law by the offender is expressly declared to be an element of the offence." In criminal law at least every offence has its elements e.g to prove rape you need lack of consent, penetration, and unlawfulness of the act, now the exception about provides that while ignorance of the law is no defence but where the proof of offence in question one of the elements is the knowledge by the offender that there is a law criminalizing such act. Thus, it is for the accused person to prove that knowledge of the law is one of the elements, just like penetration in cases of rape, of the offence lack of which no crime can be established. So the exception is on the knowledge of the existence of the law (statute) as an element of the crime/offence.
On the second limb, it should be understood that the provisions in the penal code are set to govern court and stakeholders in criminal matters the same can not be shifted to apply to civil matters because there are special legislations for that matters which are many like LMA, LCA, CPC and others. Thus the same can not apply in civil matters but specific laws governing civil matters will apply, now whether the same have that same provision as in PC that is subject to perusal and simple research.