US patent claiming Compound A or its salt (X salt included in laundry list) published after another US application filed as compound A's X salt and gets grant. They do not share common priority and inventors except applicant. Later patent can be challenged or can earlier patent be prior art for later patent?
It is all about the filing dates. If application A is filed first then application A may be considered prior art for application B even if application B is filed before application A publishes. It doesn't matter whether or not application B was developed independently of patent A. This is true even if the application A never gets granted as a patent.
I am not a lawyer and this is not legal advice.