I cannot reproduce the error using:
def random_crop(imgs):
    imgs = torch.tensor(imgs)
    change = torch.nn.Sequential(
        transforms.RandomCrop(427),
        transforms.RandomAdjustSharpness(1, p=1)
    )
    imgs = change(imgs).numpy()
    return imgs


first_img_data = torch.randn(3, 500, 500)
foo = random_crop(first_img_data)
plt.figure()
plt.imshow(np.squeeze(foo.transpose(1, 2, 0)))
plt.show()