The issue is tracked here 90.
As a workaround, you could pass fill=(0,) to transforms.RandomRotation as suggested in the linked comment:
transform = transforms.Compose([
    transforms.Grayscale(num_output_channels=1),
    transforms.RandomRotation(10, fill=(0,))
])

img = transforms.ToPILImage()(torch.randn(3, 224, 224))
img = transform(img)

Note the comma in the argument.