On Mac g.getInternalContext().getPhysicalPixelScaleFactor() seems to return 4.0 in a standalone application (I saw there was another thread from 2017 that had to do with VST, but this is not even running inside a plugin).
Inside CoreGraphicsContext targetScale is 2.0, which is then further multiplied by the CoreGraphics context scale factor, resulting in 4.0.
When USE_COREGRAPHICS_RENDERING is set to 0, the returned value is correct and is 2.0.
I believe, a better fix would be not to return targetScale, but to change juce_mac_NSViewComponentPeer.mm to pass 1.0f for the targetScale when the context is created (right now it passes displayScale). Then again, probably it’s best to let JUCE guys fix it.