The ECM needs the speed signal from the speedometer to manage idle speed, so it’s common for the engine to stall in that situation. First test the speed sensor, hope that’s all it is. If the speed sensor is good, the speedometer itself can be bad.
I had a similar issue with an SE, got wet, wouldn't accept a charge, was bootlooping... new fully charged battery didn't fix it - replaced the charging port board and everything worked after that. If you don't have another 5s to swap parts with, I suggest trying a new charging port board.
cured my 6 plus touch issues by removing the logic board, peeling the sticker back from the touch IC chips, folding clean white piece of paper to four layers thick and trimming it to fit under the sticker, put it back together and it's fine. The contact point under the IC chip must have a crack and the paper is putting just enough pressure on the chip to maintain the connection. I don't have the tools (yet) to refloat/resolder the chips.
Your accessory circuit has no power, it feeds the starter relay so that's why it won't crank. Since your lighting circuit is ok, I would look to your accessory fuse/breaker and the ignition switch first.
The two issues very likely are connected. The serial communication bus connects all the modules, and the engine management system manages your ignition timing and idle speed control differently if you're moving vs rolling. Often the engine will stall when coming to a stop when the speedo has failed. First define what you mean by "not working" on the speedo - not registering speed? Odometer not displaying or not advancing properly while riding? Backlight not lighting up? Needle whipping about violently? Cure the speedometer issue and there's a good chance it will run better.
I'm afraid the shift shaft or shift fork plate/hook is sheared off inside and unable to rotate the shift drum. On the XL models, you'll have to remove the outer primary cover and clutch basket to get access to those parts.
Check your injection system computer for stored trouble codes. Watch for the check engine light behavior when you're having issues. If you have no codes, your throttle position sensor might be getting flaky in it's old age, especially in that specific throttle position where it lives when cruising most of the time.
If it's screeching and not turning over the engine, then most likely the starter clutch is blown out. The part is available separately, and the starter motor has to be removed and disassembled to replace it.