Are you sure the variable embedding_dim is the same across both executions? From the code you’ve given, it indicates that embedding_dim = 28 in the first execution and embedding_dim = 32 in the second.
I don’t know how you load the weights in the model after initialization, but you could also try to call it this way: model.load_state_dict(checkpoint, strict=False) to ensure that non-matching weights do not get copied (and do not throw errors like this one), however it has the side-effect of failing silently (e.g. if you actually have a mismatch, the layer will not load weights and will be initialized by default, which is not ideal in fine-tuning or inference). I think it only tries to load weights with perfectly matching names (e.g. fc0.weight) so it will probably not be useful in your case.
You can also try to comment the line self.fc0 = nn.Linear(...) to see if the next one (with fc1) crashes due to embedding_dim being different than the loaded model.