Sir: This scenario is becoming more frequent as these bikes continue to age. In all probability, it's an electrical gremlin causing an intermittent loss of power to 1 or more critical components. Performing the below simple maintenance procedures should resolve it. Avoid switching around fuses and relays to other circuits. That typically just moves the problem from one circuit to another.
All your fuses and 3 relays located in main box under seat on all CityX models. Fuses are a few cents each...relays are $6 each at either H-D dealerships or local auto parts store. They cross-over to popular Chrysler and Ford A/C relays. Match yours up accordingly.
1-Disconnect both battery cables. Thoroughly clean both battery terminals and cable ends. Momentarily touch both cable ends together...hold for 5 seconds...release...then reconnect to correct battery terminals.
2-Spray Kano Kroil or similar cleaner/solvent/lubricant into ignition switch and work back and forth.
3-"""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""" kill switch assembly and work back and forth.
4-Accessing fuse box....remove and discard the following fuses: KEY SWITCH-IGNITION-FUEL PUMP. Thoroughly clean the female sockets of each and replace with new fuses.
5-If included in intermittent power loss is dead gauge/dash cluster....then replace KEY SWITCH RELAY first.
6-If not, then simply replace IGNITION relay.
Ride and see if problem resolved and report back. Helps other board members.