The primary PAN number on minor's demat account is minor's own PAN number. Thus it doesn't cause any conflict when applying in IPO as only primary PAN Number is considered for checking the duplicate application.
Many people apply in IPO with all their family members' name (including major and minors) to increase their chances of allotment in case IPO oversubscribed multi-fold.