# Buggy code
def _append(self, instruction, qargs, cargs):
    """Append an instruction to the end of the circuit, modifying
    the circuit in place.

    Args:
        instruction (Instruction or Operator): Instruction instance to append
        qargs (list(tuple)): qubits to attach instruction to
        cargs (list(tuple)): clbits to attach instruction to

    Returns:
        Instruction: a handle to the instruction that was just added

    Raises:
        QiskitError: if the gate is of a different shape than the wires
            it is being attached to.
    """
    if not isinstance(instruction, Instruction):
        raise QiskitError("object is not an Instruction.")

    # do some compatibility checks
    self._check_dups(qargs)
    self._check_qargs(qargs)
    self._check_cargs(cargs)

    # add the instruction onto the given wires
    instruction_context = instruction, qargs, cargs
    self.data.append(instruction_context)

    # track variable parameters in instruction
    for param_index, param in enumerate(instruction.params):
        if isinstance(param, ParameterExpression):
            current_parameters = self.parameters

            for parameter in param.parameters:
                if parameter in current_parameters:
                    self._parameter_table[parameter].append((instruction, param_index))
                else:
                    if parameter.name in {p.name for p in current_parameters}:
                        raise QiskitError(
                            "Name conflict on adding parameter: {}".format(
                                parameter.name
                            )
                        )
                    self._parameter_table[parameter] = [(instruction, param_index)]

    return instruction


# Traceback (qiskit.exceptions.QiskitError)
import qiskit as qk
p = qk.circuit.Parameter('p')
qc = qk.QuantumCircuit(2)
rz = qk.extensions.standard.RZGate(p)
qc.append(rz, [0], [])
qc.append(rz, [1], [])
print(qc)
┌───────┐
q_0: |0>┤ Rz(p) ├
├───────┤
q_1: |0>┤ Rz(p) ├
└───────┘
qc.bind_parameters({p: 3})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/circuit/quantumcircuit.py", line 875, in bind_parameters
new_circuit._bind_parameter(parameter, value)
File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/circuit/quantumcircuit.py", line 897, in _bind_parameter
instr.params[param_index] = instr.params[param_index].bind({parameter: value})
File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/circuit/parameterexpression.py", line 68, in bind
self._raise_if_passed_unknown_parameters(parameter_values.keys())
File "/Users/kevin.krsulichibm.com/q/qiskit-terra/qiskit/circuit/parameterexpression.py", line 136, in _raise_if_passed_unknown_parameters
[str(p) for p in unknown_parameters]))
qiskit.exceptions.QiskitError: "Cannot bind Parameters (['p']) not present in expression."

# Fixed code
def _append(self, instruction, qargs, cargs):
    """Append an instruction to the end of the circuit, modifying
    the circuit in place.

    Args:
        instruction (Instruction or Operator): Instruction instance to append
        qargs (list(tuple)): qubits to attach instruction to
        cargs (list(tuple)): clbits to attach instruction to

    Returns:
        Instruction: a handle to the instruction that was just added

    Raises:
        QiskitError: if the gate is of a different shape than the wires
            it is being attached to.
    """
    if not isinstance(instruction, Instruction):
        raise QiskitError("object is not an Instruction.")

    # do some compatibility checks
    self._check_dups(qargs)
    self._check_qargs(qargs)
    self._check_cargs(cargs)

    # add the instruction onto the given wires
    instruction_context = instruction, qargs, cargs
    self.data.append(instruction_context)

    # track variable parameters in instruction
    for param_index, param in enumerate(instruction.params):
        if isinstance(param, ParameterExpression):
            current_parameters = self.parameters

            for parameter in param.parameters:
                if parameter in current_parameters:
                    if not self._check_dup_param_spec(
                        self._parameter_table[parameter], instruction, param_index
                    ):
                        self._parameter_table[parameter].append(
                            (instruction, param_index)
                        )
                else:
                    if parameter.name in {p.name for p in current_parameters}:
                        raise QiskitError(
                            "Name conflict on adding parameter: {}".format(
                                parameter.name
                            )
                        )
                    self._parameter_table[parameter] = [(instruction, param_index)]

    return instruction