analogWrite(PIN, 1023)  digitalWrite(PIN, HIGH)
I can confirm that 1023 does indeed give 100% duty cycle. I connected an output of my D1 Mini to my oscilloscope and got a steady voltage.
I can also confirm that the same voltage is output for digitalWrite() and analogWrite().
However the output drivers may not be the same. With analogWrite() it may be using a weaker output driver that can't deliver as much current, so the voltage droops slightly more than it would with digitalWrite(). However even with a 470Ω resistor connected between the output and GND (the smallest value I had easily to hand in a through hole variant) I see no variation in the voltage at all.
So if there is some variation then it might be some variable that is showing a variation in your specific unit but not mine.