Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of –1 and are never chosen.
I understand local preference is local to the AS in which it is configured.... and so is advertised to all local i-bgp peers...https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/statement/local-preference-edit-protocols-bgp.html"The LOCAL_PREF path attribute always is advertised to internal BGP peers and to neighboring confederations. It is never advertised to external BGP peers."
Also, a router will chose ebgp learned paths over ibgp learned paths.
So it seems that if R2 is learning about reachability to R4 via ebgp between AS 123 and AS 4... and R2 is also learning about R4 reachability via it's local ibgp sessions.... R2 will choose its ebgp learned path, and so the local pref you mention is not regarded at allhttps://www.juniper.net/documentation/en_US/junos/topics/topic-map/bgp-route-preference.html#jd0e506"...Junos OS always prefers EBGP routes over IBGP routes"