Solved by jfix in post #2 
              
              
                MaxPool has two outputs, Result and Argmax. For multi-output nodes you need to select a specific output when using it, for example maxPoolNode->getResult() or maxPoolNode->getArgmax(), instead of just using maxPoolNode as an input to another node.