U can see this as matrix multiplication.
Assuming u have a matrix called input that is being multiplied by a matrix called weight to give another called output such that
input x weight = output.
If input shape = (1, 5)
and output shape = (1, 10)
It means that the shape of ur weights = (5, 10)
Now that the network has been trained on such inputs and outputs, the weights will have a fixed shape. This means that any input that is not of shape (1, 5) will be incompatible with the weight and will hence throw an error.
So yes it is normal to get these kinda errors if u try to run inference on a differently sized image with a network that was trained on a specific image size.
So what I suggest is to create and algorithms the scales down the input the the required size.
I really Hope this was helpful.