finder search window – functionality of keyboard shortcut changes
On my computer, ⌘⌥+T toggles the toolbars on/off. 
Maybe you have this keyboard shortcut set to ⌘⌥ + M,N,B,V, or C, such that you accidentally hit both shortcuts?

You can check in your SysPrefs &gt; Keyboard &gt; Shortcuts pane, or just try those shortcuts that are near the space bar.

I suggest this because of your assertion that it happens "sometimes", which is pretty weird.  I did once have my toolbars always missing, which it turns out required some preference file to be deleted or something.  But I've never seen an intermittent issue like that.