Montesquieu's use of of the British constitution in De L'Esprit des Loix as an example of the separation of powers has been seen as somewhat ironic by constitutional scholars over the years for the very reason that you mention. The legislature and the executive are not really that separate, and the office of Lord Chancellor, outranking the Prime Minister, actually involved all three supposedly separate powers in one, as the Lord Chancellor presided over the upper house of the legislature, headed the judiciary, and was a politically-appointed (not elected) member of the Cabinet.
Here's what a Law Professor at Oxford Brookes had to say on the subject before the position was reformed:
[…] the position of Lord Chancellor is difficult to defend for a number of reasons. First, its cross-institutional nature does not accord with even the weakest doctrine of the separation of powers. The notion that a government minister should be head of the judiciary would seem to undermine, rather than protect, judicial independence.
— Diana Woodhouse (2001). The Office of Lord Chancellor. Hart Publishing. ISBN 9781841130217. p.12
She goes on to quote Professor Gavin Drewry from an article in 1992:
The "multiple rôle" of the Lord Chancellor has always entailed "a heroic piece of stagecraft, one which requires a massive suspension of disbelief on the part of the spectator".
— Diana Woodhouse (2001). The Office of Lord Chancellor. Hart Publishing. ISBN 9781841130217. p.13
And also, quoting Lord Mackay at the end:
Certainly any measurement of the instututional arrangements of British government would fall far short of the definitive version of the separation of powers. The law lords sit in the legislative chamber of the House of Lords and thus have a legislative function […] Much more significant is the fusion of the legislature and the executive, whereby ministers are members of both agencies and are involved in both functions, and the fact that functions, which can be most conveniently be labelled "judicial or legislative" are frequently carried out within government departments rather than by the courts. Such arrangements […] clearly diverge from "that antique and rickety chariot known as the separation of powers".
— Diana Woodhouse (2001). The Office of Lord Chancellor. Hart Publishing. ISBN 9781841130217. p.18
She goes on to highlight the legal fictions by which the monarch, the one person at the very top, is seen to be be three different people: the Crown-in-Parliament, the source of justice, and the person whose ministers form the executive. The U.K. is a monarchy, after all. It's what the "K" stands for.
Further:
[…] rather than supporting "our democratic institutions", the position of Lord Chancellor wold seem to break all the rules of a modern democracy. Not only is its occupant unelected and unaccountable to an elected body, but it would seem "undemocratic and monarchical for one person to exercise so much control over the judiciary".
— Diana Woodhouse (2001). The Office of Lord Chancellor. Hart Publishing. ISBN 9781841130217. p.22
There is a lot more on this there.
In reality, the separation of powers that you may be used to from countries where this is formally part of a written constitution, are not present in the unwritten U.K. constitution, which is quite messy, blurred, and overlapping. The Lord Chancellor was an extreme case, but there are others. The executive has strong control over the legislative agenda. The legislature permits a wide range of executive lawmaking through statutory instruments. The executive can (albeit that again this has been somewhat reformed) cause the legislature to be dissolved. And so forth.
Montesquieu influenced other countries, that adopted written constitutions afterwards, where one will see far stronger separations than what can be seen in the U.K.. The exemplar of separation of powers that he actually had available to him at the time does not compare particularly well, these centuries later. (There is, indeed, actually a school of constitutional thought in the U.K., certainly at least until the turn of the 21st century, that the separation of powers is not necessarily the best of ideas in the first place. This seems heretical to those who take it as axiomatic that separation of powers is a good thing, but it was seriously held by some U.K. constitutional experts.)
Of course, on the gripping hand, this is not "nearly always" by a long chalk. As mentioned, a fair number of post-Montesquieu constitutions exist which do embody this principle quite strongly. And even looking at Westminster systems alone, there is a spectrum.