Unwanted shut down of outputs.

  • I did set it to Input: pinMode(switchPin, INPUT); // Set the switch pin as input

I missed that. Sorry.

  • I did connect the switchButton, using the pull up resistor connection as below:

That looks fine. It uses two external resistors when none is really required, but it works.

  • Is there anything i need to enable on software side ?

Not since you have external hardware.

I was suspecting a floating pin condition, but that does not appear to be your problem.

Perhaps seeing the serial output would be useful.