transformed_image is the transformation, not the actual transformed image.
You would have to define the transformation first and pass the input image to it.
Use this code instead:
new_image = Image.open(‘new_image.jpg’)

transform = transforms.Compose([
    transforms.ToPILImage(),
    transforms.Resize((28, 28)),
    transforms.RandomGrayscale(p = 1.0), # Transforms the image to a gray-scale
    transforms.ToTensor(),
])

transformed_image = transform(new_image)
transformed_image = transformed_image.unsqueeze(0)
check_image(transformed_image, model)