That said, N95 masks can work fine if you fit them properly, which may involve shaving any facial hair outside of a mustache, shortening the rubber straps, or adjusting the metal nose bracket.
It’s worth noting that an n95 mask doesn’t really provide vapor protection so it may not do too much for you while you’re painting but if you’re getting wood dust inside then your mask was either improperly fitted or it’s the wrong size for your face.
I've used them while working on-site at a coal mine, as long as you're using a genuine high quality n95 mask and have it properly fitted you can absolutely wear one for 4+ hours without the inside getting contaminated. It's certainly not fun but I've done it many times without issues.