If you set them equal to each other, it will fire only if the button is pressed continuously. If you instead put them into if statements, all will resolve!
Please note, the festo is not a double, red code reflects change.
You’re not giving enough information for us to know what you think “work properly” means.
A double solenoid will switch states when a control signal is applied, and will stay in its current state when the signal is removed. If you wire it properly and simply copy OI button inputs to RC relay outputs, you can use one button to make the solenoid switch one way, and another button to make it switch the other way.
A Festo solenoid will sit in one state when the control signal is absent, and will go to the other state only while the signal is applied. If you wire it properly and simply copy OI button inputs to RC relay outputs, you can use one button to hold the solenoid on; releasing that button will make the solenoid turn off again.
The code posted by dm0ney does not simply copy OI button inputs to RC relay outputs. It interprets OI button inputs as desired actions and controls the RC relay outputs to cause those actions. If you don’t press both buttons simultaneously, the double solenoid part of the code has the same effect as your code. The Festo part turns it on when p4_sw_aux1 is pressed and leaves it on when the button is released, and it turns it off when p4_sw_aux2 is pressed and leaves it off when the button is released.