Accessing the same port using regular PORT and consequently with VPORT gives unexpected behavior.
Consider these two code examples:
First:
ldi r24,1
out PORTA_OUTSET,r24
sbi VPORTA_OUT,1
//after this, bits 0 and 1 of PORTA should be set, but bit 0 is not set
Second:
ldi r24,1
out PORTA_OUTSET,r24
nop
sbi VPORTA_OUT,1
//this works as expected
The problem is that read-modify-write of the VPORTA_OUT is done on PORTA_OUT state, that is obsolete an the moment. This issue has something to do with propagation delay of PORT operations. SBI instruction reads the PORTA_OUT state before the previous instruction is fully propagated through the flip-flops and the PORTA_OUT value is updated.
When debugged step by step, the PORT has enough time to update and the error doesn't come up.
Conclusion: Using VPORT and read-modify-write instruction should not be used right after PORT write through STS.