Are you sure that the mains powered battery charger has failed rather than the power supply that feeds it?
I’m guessing that your boat is a 2001 Bavaria 42 and that it has a similar electric distribution board to that on my B36(2002) which has a green indicator light on the board when mains power is connected. So before writing off the battery charger, I would check, for example, that calorifier heater switch light actually lights up when the heater is switched on.
On my B36, the battery charger was wired directly from the RCD trip switch such that the charger came on automatically whenever the mains power lead was plugged in and live. (I didn’t like that set up and fitted a separate switch so that I did not need to have the charger running all of the time.) That aside, the RCD device recently burnt out and that stopped all mains powered systems from working even though the green indicator remained illuminated, and hence my question above. New RCD devices were readily available last year on eBay when mine burnt out, but I would check first that you actually have mains power to other systems and including going to the charger before deciding to remove the charger.
If you have already done those checks and it still doesn’t work, are you able to remove the cover from the charger and move the cover to one side to allow access to the interior of the charger to see if there is an internal fuse that may need changing?
Do remember to unplug your shore power cable before doing any work on mains powered equipment.