It would have to be a 32/64/128 channel poe NVR if 17-19 cameras work sometimes.
Could be a bandwidth issue, could be a network setup issue. The cameras on the switch will have to be on the same subnet as the lan port of the NVR, which would be different than the internal subnet of the poe...