Logout redirects to a broken page(home URL is omitted)

Found the answer. It is a bug in WordPress v5.2.3 affecting WordPress in Windows environments. Caused by backslashes in Windows paths that aren’t stripped correctly

Details here: https://core.trac.wordpress.org/ticket/47980

I have tried the patch suggested and can confirm it solves the problem.

replace:

$location = "https://wordpress.stackexchange.com/" . ltrim( $path . "https://wordpress.stackexchange.com/", "https://wordpress.stackexchange.com/" ) . $location;

with

$location = "https://wordpress.stackexchange.com/" . ltrim( $path . "https://wordpress.stackexchange.com/", '/\\' ) . $location;

in /wp-includes/pluggable.php, line 1404

It says it will be fixed in version 5.2.4