"Product" in quotes as my examples aren't so much products

. I'm looking to expand my toolbox and get any input on solving a couple issues I've had.
Let's start with examples. This is a living moth pupa (tomato hornworm, Manduca quinquemaculata) and these sets are taken ten days apart. It's about 5.5cm long, so not huge but also not tiny. It's capable of movement, when disturbed the articulated bits near the bottom can thrash about. In both cases, the left photo is the end result, middle photo is the main photo of the pupa, right photo is a clean photo of the background:
The green background one was supported on glass (which is always dirtier than I expect it to be), the brown on a little thread hammock. The goal was to layer in photoshop with the clean background behind and use a layer mask to knock out the threads, or dirt on the glass or any reflections, etc and allow the clean background to show through.
My problem in both cases was a very slight shift in the background brightness or colour that made the edges of these masks very obvious, even with a nicely feathered brush. I ended up completely masking out the background in the middle photos and replacing it with the right photo and my hope of being wantonly lazy didn't totally pan out. Having
nearly the right'colour background did make this masking a little more forgiving than if I was replacing with a totally different colour., so all was not lost
Both used an SB-28 in a small DIY softbox (with plenty of time to recharge), processed raws in LR identically, calibrated with a x-rite passport. I'm thinking it's minor variations in the flash that caused me grief, or I'm just asking for too much. The glass layer in the first example also didn't help with the colour shift. Any suggestions to make it match more exactly? My attempts at doing it in post with layers or curves was poor, is there something like an automated curves tool in PS that let you set control points you want to match and let it smoothly sort the rest?
Or any other suggestions for this sort of thing? For inanimate objects, I've done the glue object to thin thread and hang (so you have only one thread to remove), and I've done the glue object to a stick carefully protruding through the background but hidden from the camera. Straight-up cloning instead of background replacement is also simpler if you're after a monotone smooth background.
Thanks for reading this far and I'm open to any input