pheatmap Converted to ggplot Fails to Display

After converting a pheatmap to a ggplot object using ggplotify, the heatmap does not display on the screen when trying to show it in a shinydashboard. Although it is possible to download the image of the ggplot object using a download button, it does not display on the screen for some reason. Could you please provide a simple idea as to why this might be happening? Since the script is very complex, spanning thousands of lines, I am refraining from posting it here.

Maybe it would help to create a minimal reproducible example. Can you create a minimal app (with fake data), that just creates the pheatmap and display as ggplot, using the same code as in your full app?