Suppose you have a level less than single-screen, so there are grey inactive areas around the play area. Now have two lemmings close to the edge, so you need your cursor to overlap A but not B, in order to assign to A. Sometimes the cursor will have to move off the play area for this. If it does, NL will refuse to let the cursor "see" the lemming and assign it the skill, even though it's within normal overlapping distance.
Finally took a look at this, and unfortunately, it's going to be a bit of a messy one to solve. Essentially - the play area and skill panel are "forms within a form" on a technical level, so once the mouse cursor moves outside the play area, it basically doesn't exist as far as the play area is concerned.
I had hoped to fix this for 12.12, but I'm going to have to delay that for now based on that some major revision of how mouse input is handled would be needed in order to fix this. (It would be good to get this done anyway - it would tidy up some code for other features that have specifically been coded to work around this.)