Of course, the difficulty of nailing this on a really good Diddy Kong would be exceptionally difficult.
However, at least for Sonic, there are several ways to set Diddy Kong up into the lock if he's not careful.
If a Sonic who's knowledgeable and consistent with the lock hits you with a sideB while holding a banana in his hand, you are getting locked. No exceptions.
Same applies to his downB, though the difficulty in footstooling jumps exceptionally high because of opponent DI. SideB isn't effected by this because there's not much outside of amazing DI that can avoid the footstool at low percents.
Sonic has other setups, but the spins would probably be the strongest and easiest to land, considering the difficulties in landing any other variant of the lock. Hell, if there's another banana near Sonic, and he tosses the first one and it successfully hits, Sonic has PLENTY of time to grab the other banana, run over to Diddy, and start the lock from that point on.
The fact that his animation for braking during a run can be canceled out prior to the end of the animation kinda helps Sonic out in terms of mobility as well.
Basically, at least when it comes to Sonic, the Diddy should be aware of how easy it is for a Sonic, who can pull off the lock with near perfect precision, to land the lock, because it does lead to a KO if he doesn't screw up once the lock begins.
Anyways, yeah, on another note, I'm a name-searching *****.