I encountered the same issue in Postgresql 18 on Windows 11. Solutions from other answers did not help.
In my case the issue got fixed by installing the latest C++ Redistributable.