The System variable ‘$Sunset’ is always between sunset and sunrise, so if the other condition is met, the piston will fire. I think you want the statement to be: Time is between sunset and sunrise
Don’t choose ‘Variable’ from the drop down list. Chose ‘Virtual Device’ (second one from top) and then ‘Time’ at the bottom of that drop down. You’ll then be able to select the Presets for Sunset and Sunrise and then do the ‘is between’ choice you want.