I don't know if this is technically an answer ... but this now seems to be a non-issue. I used the OP code in VS2022 C++ with LibXL v4.5.1.
bugged.xlsx provides the calculated value in Sheet 2 when first opened. Calculation by keypress is not required.