Thank you for your response. I printed mapping right after it got defined and here is what the map contains:
{(10.0, 133.0, 1.0): 0, (243.0, 5.0, 247.0): 1, (255.0, 255.0, 255.0): 2}

So we see green, pink, and white as expected.
As for the transformations, I simply normalize and then convert the training image or mask to a tensor (I apply the same transformations to the image and the corresponding mask).
The only transformation that could seem problematic is the normalization but even with disabling that transformation and keeping the tensor conversion one, I still get the same behavior unfortunately.