The model architectures are not equal, so a different behavior is expected.
Some differences after a quick check (model1 refers to the custom nn.Module and model2 to the nn.Sequential):

2 pooling layers in model1, 3 in model2

additional torch.nn.Conv2d(128, 128, kernel_size=3, stride=2, padding=0) layer in model2

different linear layers (8704 vs. 1024 in_features)

5179586 trainable parameters in model1, 1059074 in model2