It looks like that using lvgl, setRotation needs to be done as part lv setup as discussed here
where I found the original solution from Dave:
// Initialize the TFT display using the TFT_eSPI library
disp = lv_tft_espi_create(SCREEN_WIDTH, SCREEN_HEIGHT, draw_buf, sizeof(draw_buf));
// trying to rotate screen
lv_display_set_rotation(disp,LV_DISPLAY_ROTATION_90);