From source4/torture/smb2/lock.c line 2075:
SMB2 doesn't like lock and unlock requests in the
same packet. The lock will succeed, the unlock will fail with
INVALID_PARAMETER, and the lock will be unlocked before return.
So Samba is rolling back locks if encountering an UNLOCK flag in locks array.
From MS-SMB2 188.8.131.52.2 Processing Locks:
For each SMB2_LOCK_ELEMENT entry in the Locks array, if SMB2_LOCKFLAG_UNLOCK is set, the server MUST fail the request with STATUS_INVALID_PARAMETER and stop processing further entries in the Locks array. All successfully processed Lock operations are not rolled back.
Spec is expecting no roll back.
It might violate the spec, but does it violate "what Windows does" (tm) :-).
Can you run the test against a recent Windows10 server and see if it passes ?