Pressing Ctrl+F twice on topic search should close the Discourse search window

No, it’s not a bug. That is intentional. You can read about it in older discussions:

「いいね!」 2