Michael
When I have changed the cable on mine I have followed Rohloff’s instructions and it worked well for me. When I held up my replacement next to the one on the bike it certainly looked like it would fit and it did when I put it in. While they don’t have to be the exact measurement specified by Rohloff, there are limits. If they are too long then the black concertina tubes would be stretched beyond capacity in gear 1 or 14. Or the female bayonet connector could hit up against the mounting on the break. If they are too short then as you change into gear 1 (or 14) the bayonet connector on the short end would either hit up against the axel ring assembly or reach the limit of how much the black concertina tubes can be compressed, preventing you from getting into those gears. I suspect the available screw adjustment on the break mounting would be more limiting than these other two constraints. It certainly seems to be on my Raven Tour.
I just ducked down to the basement where my bike is parked and made some measurements. These were made with an old plastic ruler in low light, without glasses and with everything still on the bike. So be warned, they could easily be out by several mm! When I have my cables even the distance from the centre of the axel to the tip of the two male bayonet connector is ~155 mm. When I go into gear 1 or 14 the distance from the axel centre to the tip of the longer male bayonet connector is ~ 208 mm.
So to answer your question, I don’t think they have to be exactly 165 mm but you only have a few mm tolerance to work within.
If you could post some photos of your existing axel ring assembly and its replacement we may be able to offer more help.
Peter