Yes, you may file a Form 1040-NR even if you didn’t spend so much as a day physically present in the U.S. Indeed, I’ve had clients who have filed those returns for years and who have never, ever stepped foot in the U.S. Those nonresident aliens with U.S. source taxable income are required to file that return.
As I understand the facts, the pay you received from the U.S. company was for work you performed for the company while working remotely in India. That income is not U.S. source income and not taxable in the U.S. at all. If that was your only income from the U.S. then you have no taxable income here either for federal or for state taxes and all of the income tax the employer withheld would be refunded to you. (Note that for nonresident aliens interest on bank deposits in the U.S. is also generally not subject to federal tax unless the interest is effectively connected with a U.S. trade or business. But the interest may be taxed by the state.) Since the income is not subject to tax, there is no federal foreign tax credit to claim for the tax you pay to India on that income. States do not generally provide a foreign tax credit. By the way, for the state tax you need to file a nonresident state income tax return. The federal Form 1040-NR only deals with the federal tax.
I suggest you submit the W8-BEN and stop the withholding. This would not impose any significant burden on your employer. Indeed, an employer would generally prefer that as it makes things easier and less expensive for the employer.

