First, do you have the old switch and why were you replacing it? Then, when the issue is happening, wiggle test the trunk harness. Did you install new bulbs as well? The brake/tail lamp sockets are finicky to say the least as far as the ground connections go.