The wires are going to get hot if you do this. Be sure your insulation is rated for that heat. And remember any testing you do at room temperature will be a bit wrong since the temp inside the flashlight gets so much warmer.
To a small extent, this can work. But I don’t recommend it.