That happens, because usually Vim switches to the alternate screen and works there. Upon exiting, Vim will switch back and therefore you don't see anything left from your Vim session, but the result of the command executed even before starting Vim.
This feature is explained at
:h xterm-screens (link)
So you basically don't want that and therefore want to disable that. You can do so, by setting
:set t_ti= t_te= the terminal codes that perform this to empty.
Putting it all together, you would want to start Vim like this:
vim -c ':set t_ti= t_te= nomore' -c 'scriptnames|q!'
We are resetting the
'more' option, so that you don't see the hit-enter-prompt.