Thank you for your reply, the ability to aim while dual wielding is an exclusive feature of my game. So I'm having this problem in my game.
But the problem in the picture above is an obvious bug. If you switch from a dual-handed pistol to a right-handed pistol when aiming, the Slot0ItemID is 2 and the Slot1ItemID is 0. If you still aim at this time, you cannot exit the Aim state of Dual Pistol. So I added an extra transition to judge that the Slot1ItemID is not 2 to exit the Aim state. After that the problem was solved.
Hope this helps you.