You can cast Rat Out without a target just to create a Rat token. However, if you do choose a target, and that target is illegal at the time Rat Out tries to resolve, the spell won't resolve and none of its effects will happen. You won't create a Rat token.