Issue with MQ listner Notification

I have an integration Scenario in which I have to process MQ messages in group.
webMethods will put different messages in MQ and associate them with a groupID. For the last message webMethods flow will put the message with msgFlag = last message of the group.
These messages have to be process with the below logic:
As soon as we see the last message in the group trigger a listener notification. Based on the group id get all the messages for the extracted group ID. Parse the message and build the canonical.

As per the MW adapter documentation:
Listeners and Transactional Connections
A listener that is associated with a transactional connection exhibits the following
behavior:
�� The Listener monitors the queue.
�� The Listener receives a message. (The WebSphere MQ Adapter tags this message as
unavailable, but the adapter does not remove the message from the queue.)
�� If the message matches all of the selection criteria for any notification, then the
notification processes the message.
�� If the notification processes the message, then the Listener commits the message. (The
WebSphere MQ Adapter removes the message from the queue.)
If no notification processes the message, then the Listener rolls back the message.
(The WebSphere MQ Adapter tags this message as available.)

WRT to the above text I created a Transactional connection and built a listener using the connection.
I configured a listener notification using the listener. For the notification filter criteria I have selected msgFlag to be last message in the group.
I tried testing the notification by inserting 2 records on MQ
1. With Header.msgFlag as Message in Group.
2. With Header.msgFlag as Last Message in the group.

The listener deleted both the messages from the Q and only the second message got published on the broker.
I would expect it to publish the second message on the broker and the 1st one should not be deleted as it does not match the Notification Filter Criteria.

Please let me know if I am doing something wrong