Hi AnshumanFauzdar
I'm a bit confused as to what you are really doing here. I don't think you shoud VNC into the pi if you wish to forward the display.
I think that since adding the export DISPLAY=:0.0.
you are telling the scripts to use PI as the display, so when you also VNC, the x11 won't work properly.
Could you try maybe disabling the DISPLAY, exiting the VNC and running the example (rgb_preview) with -X?
Thanks,
Jaka