Too long just give me the short answer version: don't gently tap the M6 screw with a plastic hammer, use a normal hammer and apply moderate force until there is no space between the plug (see picture below) and the motor - it helps if you put the bike upside down to see when this happens but you can feel it as well i.e. motor starts to wiggle after this happens. Don't forget to do this for both M6 screws.
To anyone else facing this issue, today I had to (again) remove my motor (PW-X, the first one) in order to replace the sensor cable.
The "gentle" tap mentioned in the Yamaha service manual is an absolute joke. I went to a car mechanic to show him and he bet this couldn't be done with a plastic mallet to begin with.
The plug mechanism (sorry for the photo, it's not from my PW-X but it's very similar) works like this:
When the motor is out of the bike,the plug is near the motor (there is no space); when you put the screws in, this plug goes away (like half of a millimeter) from the motor and this is what it makes it "stuck", what the original poster of this thread mentioned
The only trick left is to get it close to the motor again while inside the frame. This is done via what the manual says, gently tapping the end of the small M6 screw with a hammer.
However, this indication is awfully misleading because you can gently tap the end of the M6 screw all day long, the plug won't budge!
My car mechanic then used a normal hammer and applied 2-3 short but relatively powerful hits. The plug moved next to the motor and the motor was free!!
I followed the Yamaha indications by heart and couldn't move the damn plug even after 100 gentle taps with the plastic hammer.
Conclusion: sometimes it is better to use force. Not sure why in my case the manual indications don't work but keep in mind this is my second Yamaha PW-X motor with this problem.