The file gameoverlay.lua that I was trying to run through the composer.showOverlay() was an empty file, and the gameoverlay.lua that I was working on was placed in a wrong directory Major facepalm.
If run with the composer.gotoScene() I would get a error saying that the "sceneName" was a nil value(because it was empty).
Solution Make sure that the file is not empty, and is requiring composer and has a proper composer scene setup.