I don't have all your code, but I think I see what is happening. The problem is that your old code and your new code do two very different things.
Your old code defines a block. That is, I would expect to see this code in the init function of a block definition in Blockly.Blocks. This is the code that Blockly runs to instantiate a block, such as when you drag it from the toolbox to the workspace.
Your new code programmatically connects two blocks that are already in the workspace, but does so incorrectly. Assuming "this" refers to an existing block that already has a value input, your code adds a second value input (this.appendValueInput). This is why you see two value inputs in Block.inputList.
Here is the init function that defines a block that uses a value input instead of a text field. The user can connect a value block to this block.
Blockly.Blocks['my_rhs_input_block'] = {
init: function() {
this.appendValueInput('RHS_INPUT');
}
}
On the other hand, if you want to programmatically connect a new string_value_block to a block that has a single value input, you would use the following code. Notice that we get the value input from Block.inputList.
let rhsInputBlock = Blockly.getMainWorkspace().newBlock('my_rhs_input_block');