The relevant rules doesn't refer to 'legal guardianship'. They only refer to 'parental responsibility', which is what is required to be able to obtain a passport on behalf of a child:
https://www.gov.uk/get-a-child-passport
The legal problems which can occur tend to relate to actually taking a child out of the country, rather than the process for obtaining a passport to do so. For example anyone who is 'connected with' a child commits a criminal offence if they take that child out of the UK unless
(a) they have the consent of all other persons who're 'connected with' the child ; or
(b) there is a child arrangements order in place, stating that the child should live with them, and the child is taken out of the country for less than one month ; or
(c) they're the 'special guardian' of the child and not taking them out of the country for more than three months ; or
(d) a court has granted permission for the child to be taken out of the UK.
(A person is connected with a child if they're the parent, guardian, special guardian or custodian of the child).
https://www.legislation.gov.uk/ukpga/1984/37/part/I