I purchased a bike and it had no keys so I installed a switch for the ignition. The bike powered on but when I went to hit the start button there is a click noise near the battery and the bike loses all power and will not turn back on unless I disconnect the battery and wait a few minutes and then reattach the battery.
92 Nighthawk owner here.
I've experienced similar issues with a weak battery connection as the_storyteller noted in the comments. The draw from the ignition turning over will cause a loose connection to sever.
I would also check the charge on the battery if that fails. Could be there isn't enough juice to turn the starter. Then I'd check the ignition electrical connections. Then starter.
Also. Make sure your kill switch isn't hit.
<-check kill switch <-check connections on battery terminal as the_storyteller's suggestion <-check electrical connections / starter <-check battery charge (or charge the battery some)