The gears mesh with dogs on their sides, so if you want to get in gear and they are interfering the gears have to turn a bit to slide together. But getting neutral should only be pulling the 2nd or 1st gears apart... so they can't really be interfering but could jam if the dogs have been undercut... Anyway, maybe it's just balky because the clutch adjustment isn't letting it completely disengage. Maybe the shift forks are worn or bent or the drum is worn.
Depending on model the switch is a bit different but they all mechanically connect to the shift drum to close a contact when it's rotated to the neutral detent. The switch can get dirty/stuck or wear out.
Also depending on model/year there may be a starter safety unit (SSU) or a diode to allow electric starting only if in gear AND declutched, or if in neutral. The SSU could fail and make the light and starting ability act strange. The diode can only fail two ways: the starter won't work in neutral with clutch engaged, or the neutral light always comes on when the clutch is disengaged.
You could have pulled a harness connector apart a bit so the neutral switch connection is intermittent The neutral switch wire goes through the engine plug, have a look at that.