Is the t-test miscalibrated in R? When the null hypothesis is true, the p-value of a test should have the standard uniform distribution. Here is what I get with t.test(...) in R using two Gaussian samples of size 5.
set.seed(123)
p.val <- replicate(n=100000, t.test(rnorm(n=5), rnorm(n=5))$p.value)
hist(p.val, breaks=50)


You can see that there is a deficit of low p-values. Below is what I get with somewhat bigger samples of size 10.
set.seed(123)
p.val <- replicate(n=100000, t.test(rnorm(n=10), rnorm(n=10))$p.value)
hist(p.val, breaks=50)


The deficit of low p-values is gone. So what happens in the first example? Is there something wrong with t.test(...) in R for small-ish sample sizes?

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.1


Following up on @statmerkur's correct answer: first, here's what you get with var.equal=TRUE

which is well calibrated.
Second, here's the distribution of estimated degrees of freedom for the Welch t-test

As you can see, the estimated degrees of freedom are typically near 8, but occasionally quite a bit smaller. When the df is smaller, the p-value will be conservative.
Finally, here's the p-value distribution separately for estimated df>7 and $\leq 7$

