Yes if you train a CNN on a certain size image the weights of the model will correspond only to that size image. So if you change the shape in testing the model will not be able to predict it correctly because the weights will not match up with the size of the image but you won’t get an error.