You have some wire in there on the return to the lamp with damaged insulation. Likely you also have metal conduit joining them, and a metal box the switch is in. When you pulled the switch off you put this damaged wire in close contact with a part of the conduit, or you had a small excess of wire that cracked insulation ( especially in an older house with DCC wire or very old PVC insulation, which is easy to see for DCC it has a woven cotton cover and crumbly rubber and old PVC will drip green goo) and touched the conduit or arced over on switch on.
Now, you can fix this by using the old wire as a pull, to get a new set of 4 wires ( line in, neutral, return and a PE connection ) back to the likely source of the wire, in the lamp fitting. This then will get rid of the damaged wire, and give a neutral for the socket outlet, plus a better ground connection.
In the light you will have to join the line to the existing and insulate it, either with a Wago connector or a ceramic wire nut and tape it up ( wire nut local code determines if you can use it, here it is an approved method with a ceramic nut) The neutral in the light will need to join 3 wires, one the neutral to the board, one the short stub to the light and the third the neutral to the switch. This also needs to be insulated as if it i live conductor, as it is one. The return wire can go straight to the lamp socket. The ground wire must be connected to the metal case of the ceiling rose using a screw, picking up the conduit there. Reason for separate ground is that the use of conduit as ground is no longer allowed, as there can be PVC conduit in there, which is not conductive, and which might have been put in during renovation, ideally the ground should be all the way back to the consumer unit and connect there to the earth busbar, but you will have to pull all the cabling along the way and replace all of it to do so, YMMV.
Then you just replace the ceiling rose with the light socket attached to the new wires ( old one likely you will buy a new one), replace the lamp and cover. Switch side you connect the new switch, with the shaver socket cable fed out through a cable gland ( so as not to cut the sheath with time) and put the light switch back, turn on the circuit and check light works and shaver does as well.