I have read that one can pray mincha gedola be'minyan instead of mincha ketana be'yachid.
But would praying "just before shekiya" be'minyan still be more recommended than mincha ketana be'yachid?
Mi Yodeya is a question and answer site for those who base their lives on Jewish law and tradition and anyone interested in learning more. It only takes a minute to sign up.Sign up to join this community
Aruch HaShulchan Orach Chaim 233:7 writes that ideally, one ought to pray mincha between mincha ketana (9:30) and plag hamincha (10:45).
This is based on Rambam Hilchot Tefilla 3:4. Aruch HaShulchan understands that practically the tamid was always offered before plag hamincha, because they needed time for the ketoret, nesachim etc. afterwards. However, bedi'avad its time was indeed until evening.
Aruch HaShulchan goes on to note that we generally are not particular to do this, instead praying close to sunset, because it is difficult to gather a minyan before plag hamincha.
He points out that if one is anyway praying individually, he should pray between mincha ketana and plag hamincha. However, we can infer that it is preferable to pray with a minyan between plag hamincha and shekiah if one cannot pray with a minyan earlier, making sure to finish before shekiah.
For Mincha The Sheilot utshuvot haRadvaz (Rav David Ben Zimra Rav in Egypt 16th century) 1,676 says that ideally Mincha should be done after Mincha Ketana (2.5 Halachik hours before night time when dividing daylight into 12 hours) when possible because that was the time of the Korban Tamid. Ideally, only if one is certain he won't miss the time for Davening Mincha, he should Daven just before shekia (sunset) making sure to complete it just before sunset:
ולכתחלה מנחה קטנה עדיף שזו זמנה כנגד התדיר וזו כנגד ערבי פסחים שאינו תדיר וכן כתב הרב פ"ג מה' תפלה ואמ"ר חייא בר אבא א"ר יוחנן מצוה להתפלל עם דמדומי חמה שנאמר ייראוך עם שמש ואע"ג דלייטי עלה במערבא הנ"מ מאן דמאחר טפי אבל קודם ביאת השמש כמעט שפיר דמי
Indeed the Arizal also did like his Rebbe the Radvaz and Davened Mincha just before Shekia which is the most auspicious time, as quote in Ben Yehoyada Brachos 29b
פתח עינים ז"ל בשם תוספות ישנים כתב יד, בשעה שיצא ונכנס הוא אדום כדם, וזהו דמדומי חמה...רבינו האר"י ז"ל היה מתפלל מנחה עם דמדומי חמה, כסברת ר' יוחנן דסבירא ליה במערבא לא פליגי על ר' יוחנן, אלא הם דברו בהמון העם בעל עסקים
When davening with a minian one has to convene at a set time and therefore will not let the time pass, so it is even more ideal to daven with a Minian just before Shekia. But if one is on his own with jobs to do without anyone to remind him then he should daven at Mincha ketana rather than risk missing Mincha.
FYI, mincha ketana begins from 9.5 hours into the day (where an hour is a "shaa zemaniyos" hour which is based on the length of time between netz and skiyah or alos and tzies hakochvaim) so "just before shekiya" falls within the range of mincha ketana. They're not two different times unless you meant to say at the beginning of mincha ketana.
Based on what you wrote in your question, I am interpreting that you are asking is it better to daven earlier without a minyan but within the proper time for mincha or is it better to daven with a minyan at the "buzzer" (the last possible moment risking going past shkiyah.) If I do not have the question correct, I apologize and please reword it so we can understand it better.
If I have it correct, as long as you get your shemoneh esrey in before shkiya, you are good and that would be preferable than davening without a minyan earlier. (I am not including a source as it is well known that one should not be quick to daven without a minyan even if they have better kavanah see Igrot Moshe (O.C. 3:7). If you will end up saying shemonah esrei after shkiyah then you run into halachik issues unless you hold like rabbeinu taam skiyah (like chasidim) who have a bit more leeway davening after what many consider shkiyah.