I discovered WiringPi doesn't work properly for the compute module 4s. On further digging, I found the function piBoardId() in WiringPi\wiringPi\wiringPi.c didn't have a case PI_MODEL_CM4S when switching by the RaspberryPiModel. The library worked as intended after adding the case and rebuilding.