Manipulating the state_dict works for me:
class MyModelA(nn.Module):
    def __init__(self):
        super(MyModelA, self).__init__()
        self.lin = nn.Linear(10, 10)
        self.classifier = nn.Linear(10, 42)
        
    def forward(self, x):
        x = F.relu(self.lin(x))
        x = self.classifier(x)
        return x


class MyModelB(nn.Module):
    def __init__(self):
        super(MyModelB, self).__init__()
        self.lin = nn.Linear(10, 10)
        self.classifier = nn.Linear(10, 1000)
        
    def forward(self, x):
        x = F.relu(self.lin(x))
        x = self.classifier(x)
        return x

modelA = MyModelA()
modelB = MyModelB()

sd = modelA.state_dict()
modelB.load_state_dict(sd) # your error

# replace tensors creating the shape mismatch with random tensors
sd['classifier.weight'] = torch.randn(1000, 10)
sd['classifier.bias'] = torch.randn(1000)
 
modelB.load_state_dict(sd) # works