As others have mentioned, window commands are very limited for the cmdline window and there is no way to move the cursor to the previous window while keeping the cmdline window open. Here is a suggestion that, though it won't allow ordinary 'window switching', may simplify returning to look at the content of the buffer from which you summoned the cmdline window.
let cmd = 'q:'
let cmd .= ':call setpos(".", g:CmdWinCurPos)^M'
nnoremap <expr> <Leader>q JJCmdWinResume()
:autocmd CmdWinEnter * nnoremap <buffer> <Leader>q :let g:CmdWinCurPos = getpos('.')<CR>:q<CR>
The idea is to allow storing the position of the cursor in the cmdline window when leaving it, and to allow returning to that cursor position when reentering it. We create a general expression map for Leader+qthat simply evaluates to opening the cmdline window (q:) if there is no cursor position stored, but if a position is stored, then it also sets the cursor to this position. Then with an
autocmd we set a buffer specific map for the cmdline window, with the same
lhs, that stores the cursor position before quitting the cmdline window. This way you can quit the cmdline window with Leader+q, look at the buffer you are working on, then reenter the cmdline window with the same keys and continue from where you left off.
^M in the function is a literal carriage return, to be entered with CTRL-V+RETURN. (If you yank-put this code you will have to replace the two characters
M in this way.)