I've not used that mod, so I don't know anything about how you were able to get it to stick to the bay. Usually, parts dont stick together like that unless its docking ports or by radially attaching them in the VAB/SPH.
While you can sort of trap a recovery part inside a cargo bay by closing the doors and letting it bounce around, its not the ideal solution as your ship and the recovery target will be 2 separate crafts. The cockpit could blow up if it bangs against your cargo bay at a speed greater than it's impact tolerance. Its a dicey, last resort kind of solution, but it certainly can work if done carefully.
The standard use of a cargo bay is on launch when you want to bring some detachable cargo to space, like perhaps a satellite or probe you're sending out. The payload is attached to the cargo bay internally, you open the doors once you reach the vacuum of space, detach the payload and now you've got 2 separate crafts:
The advanced grabbing unit I mentioned above is a part that lets you grab another craft, be it a one-part recovery contract craft or a larger ship, and when a proper connection is made, the two crafts become one. Often times, you can send a small craft with propulsion, the advanced grabbing unit, some batteries, and a bunch of parachutes which will attach itself to the contact target and deorbit it, landing safely on parachutes. Here is Scott Manley doing exactly this:
Further, you can put that advanced grabbing unit inside a cargo bay, maneuver such that it grabs the contract target, and then close the bay doors and the contract target part then becomes part of your ship and wont be rattling around inside the cargo bay.
Like almost everything in KSP there are a few ways to tackle the problem you're trying to solve. Have fun trying all the methods.