For the fuel gauge on my B36(2002) to indicate the fuel level within the diesel tank, the engine control panel at the binnacle has to be switched on. That control panel, on my boat, has a small push button switch which latches on with one push and stays switched on until it becomes unlatched at the next push which cuts the 12 volt power to all engine circuits, there is no key controlled ignition switch as such. The fuel gauge is not dependent upon any of the circuits being switched on at the main switchboard for it to show the fuel level, though the main 12 volt battery switch, located under the chart desk, does need to be turned on. So, for your gauge to indicate the fuel level, and this assumes it is wired similarly, that small push button needs to be in the “On” position. You haven’t mentioned which type of engine control panel you have, so it may be that you have a key operated ignition switch, but either way it is odds on that your fuel gauge will not work until the ignition is turned on, and with the main battery switch also in the “On” position, so I would first look to see that you have power at the engine control panel when that panel is switched on.
On my boat the engine control panel is located near the bottom of the binnacle on the aft side, and is held in place with four screws. Once the screws have been undone the control panel can be eased out to enable you to see if you have any loose or broken wires hanging off. My binnacle also has a round access hatch located on the starboard side slightly higher up than the engine panel, and through which it is possible to view the back of the engine panel, but it’s not easy.
Good luck with your investigations.