There is a big difference between the first answer you quote, on this site, and the second answer you quote, on stackoverflow: while the answer on cs.se contains an argument, the answer on stackoverflow just states the result without any explanation. This means that you can verify the answer on cs.se: you can check whether the proof is correct, and whether the result answers your question. In contrast, there is no way to know whether the answer on stackoverflow is correct or not, apart from trusting its poster.
This highlights a general difference between programmers and computer scientists. Programmers just want to know the answer, and generally don't care whether it's correct or not. Computer scientists, in contrast, want to see some evidence: a proof if one is available, or results of experiments (or both, in some communities).
Two more proofs of the formula $\frac{n(n-1)}{4}$ can be found on math.se and on cs.se. See if any of these convince you of this formula. You have to check both the statement (whether you are counting the correct expectation) and the proof.
Another thing you can do is experimentally determine the veracity of these proofs. This would entail programming both algorithms, and running them on many different arrays of length $n$ for various values of $n$, thus estimating the number of swaps.
A user on stackoverflow did a simpler experiment which suggests that the number of swaps is the same in bubble sort and inversion sort (at least for the user's version of these algorithms, quoted in the question). This would imply, of course, that the average number of swaps is the same in both algorithms.