thanks @tvdfly. I was able to solve the issue after going into instance console. The issue was when I was setting the secret with flyctl I had single quotes around the URL. I did it so the command would not break
After removing the single quotes and setting it like this has resolved the issue for me.
$ flyctl secrets set "DATABASE_URL=<PLANET_SCALE_URL>"