Coding in header vs separate cpp

Why are you creating a new instance of software serial every time the function gets called

It's a test (you know, the funcion's name is "test"). I created the test only to explore why the initialization of SoftwareSerial worked when declared on the header but not on the .cpp. That's why I don't even bother to delete that instance.

You still haven't explained why you are doing software serial on the hardware serial pins.

Yes I did:

Because the hardware serial port in the Arduino UNO comes with a serial-to-usb converter so I can debug its output from my computer using the serial monitor that comes with the arduino IDE. Of course, once it works I'm planning on using it on a different port.

The easiest way to debug the output of SoftwareSerial is of course to read it directly through the serial monitor, and that's what I'm doing. The pins have hardware serial capabilities, but that doesn't mean that you HAVE to use that capabilities.