A little more detail. Local variables are not temporary storage locations. They are essentially duplicate terminals of a front panel control or indicator. You cannot place a local variable linked to a control on the main VI into a subVI.
So, when you try to make a subVI from a segment of code which includes local variables, the LabVIEW development system creates new controls for the subVI and wires them in place of the local variables.
As crossrulz suggested, you should use wires rather than locals. With a very few, very limited exceptions local variables are not needed and not recommended in good LV code.
Lynn