Instead of going for the PipeTransform, which wasn't working properly for me, I ended up removing the @Type(() => YourClass) from the property and added a Tranform:
import { plainToInstance } from 'class-transformer';
class YourClass {
@IsObject()
@Transform(({ value }) =>
plainToInstance<NestedClass, unknown>(
NestedClass,
typeof value === 'string' ? JSON.parse(value) : value,
),
)
@ValidateNested()
property: NestedClass;
}