Hi Ronny,
Welcome!
As above suggests, in respect of backfiring don't get distracted by this, if you wanted to deliberately make the bike backfire (like a hoon!) then you would (when rolling) use the kill switch to cut off the engine, while (with clutch out) letting the engine turn over so it pulls in fuel/air mixture, then when you re-enable the ignition via kill switch it will back fire. I mention this to explain why it's happening, but don't want you to get distracted by this and assume it's a fuelling issue.
Presuming it's cutting out when running, and on all four cylinders (as opposed to just loosing power, or bogging down, or dropping one cylinder) then it's likely an ignition problem. Perhaps due to water getting in somewhere, electrical short, or similar. Can't tell you of top of head what the cause is, you'll need to go through logical process to diagnose and there are others more expert than I who can assist with this, but did want to reassure you that it's not massive worry, once sorted should be fine.
A good thing to start with would be WD40 on electrical areas such as HT leads etc as that should help displace any water. Also check the drain holes around the head/cylinder are not blocked as these are used to drain water from around the spark plug area.
The side stand is a simple mechanical switch operated by a plunger. Don't be scared to get down and have a close look near where the sidestand meets the frame. If it's all gunked up then certainly when you raise the side stand the plunger can fail to move and the bike can fail to start. But unless there is something wrong with it internally/electrically I wouldn't expect this to affect you when up and running, only when on the drive. None the less go-ahead and give it a good clean, can't hurt. Soap and water or degreaser, then some WD40 or similar to lube.
So to confirm, it's cutting out when running, or failing to start on the drive?
Now putting that all to one side, this knocking, how bad is it, and does it go away with clutch pulled in? They are a bit grabby and so do rattle a little in neutral with clutch out, although in my experience usually more when cold than hot. Any chance of a video?
Andy