Initial value for 32 bit register made using D F/F in verilog
Initializing a register in this way is implementation dependent. It will work in some FPGAs that support a global reset at power up, but in general you should expect a flip-flop to have an unknown state when power is first applied. If your application requires an initial state for the flip-flops you should add an explicit reset to your design. Since you haven't told us the circumstances where you see this behavior we can't give a specific answer.

By the way, I think there is an error in your first if...else block. Check the order of the statements.