Foot pedal to cv converter

hi all,

i’m trying to build a little box to convert a foot pedal press to a trigger/gate. i planned on doing this by running a 9v battery through the pedal then outputing it to 3.5mm.

here’s the issue - if the 1/4 in from the pedal and the 3.5mm share a ground, it stops working. if i keep their grounds isolated, then it works as intended. i have a metal enclosure, so they end up sharing grounds through the enclosure once i put everything together. can someone explain to me what is going on here? how should i remedy it (other than say, using a non conductive enclosure)?

this is how i have it wired when it works. if i connect the grounds together it stops working.

Would need to know exactly what is in the pedal and how it is connected internally.