Based on the error message it seems you are not loading a state_dict, but a custom dict class containing the 'model' key, so you might want to access it first.
Something like this could work:
loaded_model.load_state_dict(torch.load(‘src/trained-model-2021-11-23–23:08-hs.pt’, map_location=device)['model'])