Jelly (fork), 11 911 bytes
ṗ3SƘṀṢ€ṢṪṗ3SƘṀṀ_ṂƊÞḢ
Try it online!Try it online! (this is the equivalent in normal Jelly)
This uses my fork of Jelly which includes the Ƙ
(keep-like) quick to replace the commonly used <link>⁼¥Ƈ
pattern. You can see this in the TIO link.
-2 bytes thanks to Jonathan Allan by using the sorting trick from his answer!
How it works
ṗ3SƘṀṢ€ṢṪṗ3SƘṀṀ_ṂƊÞḢ - Main link. Takes a list L on the left
ṗ3 - Cartesian Cube
Ṁ - Maximum of L
Ƙ - Keep triples whose is like the maximum
S - sum
Ṣ€ ƊÞ - Sort eachthe remaining triples by:
Ṁ Ṣ - Sort maximum
_ Ṫ - minus
Ṃ - minimum
Ḣ - Take the last onefirst