I have never done this with a spacebar, but have CAREFULLY pulled off a computer key and cleaned it. Sometimes gunk will accumulate under the key and render it inoperable.
I think that the fact that it works when you hit it a second time is a good sign. It is possible that the dirt under the bar is making it work intermittently.
All the keys can be removed although the larger keys (space bar, enter key, shift keys, backspace, caps lock, etc) can be difficult to put back so you might avoid removing them.
If you are unable to replace the spacebar, you will have to get another keyboard, which you will have to do anyway, if the spacebar is not working properly. So you have nothing to lose.