No, we cannot measure the potential barrier across a p-n junction by simply connecting a voltmeter across the junction because resistance across the junction is almost infinite and no current will flow through the voltmeter.
Class 12 Physics Chapter 14 Semiconductor Electronics Session 2024-2025.