No idea why you would do that, but playing someone else as GK should not make illegal formation.