As far as I know:
When stock prices fall (quickly), risk management kicks in for major investors and the money is invested more safely in bonds. Then the price of bonds rises and the yield or interest rate falls.
For mortgage yields, it is not mainly the short-term interest rates (of the ECB) that are decisive, but the interest rates with a 10-year maturity. In particular, the yields of 10-year covered bonds that secure mortgage loans.
Supply and demand for such bonds determine the "market expectation" for the interest rates of safe bonds with a 10-year maturity.
If the ECB sets short-term interest rates at 5%, but "the market" – expecting future interest rate cuts – comes to the conclusion that 3% for 10 years is appropriate, then the real estate loan will rather carry 3% plus a surcharge for the friendly bank.