I can not understand why this error is occurring. Theoretically the error is due to not having this ID in the html, but it does exist ... I even changed the name to check if something was spelled wrong ...
<tr class="paciente">
<td class="info-nome">Paulo</td>
<td class="info-peso" id="peso-2">100</td>
<td class="info-altura" id="altura-2">2.00</td>
<
See Js ...
var tdpeso = document.getElementById("peso-2");
var tdaltura = document.getElementById("altura-2");
var peso = tdpeso.textContent;
var altura = tdaltura.textContent;
if (altura != 0) {
var imc = peso / (altura * altura);
console.log(imc);
}else{
console.log("Impossível executar pois altura é igual a zero");
}