Hi Vanessa. I will try to answer you.
What I want to say about "Alfonso IX is not connected to Ramesses II" is here at Geni. I checked that both were not on the blue line. It doesn't show a blue line connection for them (Geni grandparents line).
But this does not guarantee 100% that Afonso can be or not be Ramesses II's descendant. The lines do not go back so long ago.
There are discussions about the (dis)connections of medieval trees with those of the Ancient Period.
For example here:
www.geni.com/people/King-David-of-Israel/4793654215250024782
I am not an expert in Genetics or a specialist in Genealogy, but I can say the "Out of Africa" hypothesis is still the most reliable:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4844272/
https://www.sciencedaily.com/releases/2007/05/070509161829.htm
May be changed for the "Levant" (Middle East area) hypothesis in the future. There are some studies going on. Science never stops.
About Ancient Human Diaspora & DNA:
https://www.researchgate.net/figure/Diagram-of-the-migratory-histor...
https://en.wikipedia.org/wiki/Early_human_migrations
https://en.wikipedia.org/wiki/Early_human_migrations#/media/File:Ea...
https://en.wikipedia.org/wiki/Early_human_migrations#/media/File:Ma...
https://en.wikipedia.org/wiki/Early_human_migrations#/media/File:Pr...
It's not easy to test Ancient DNA (time & weather deterioration, contaminations, etc), but scientists do their best.
To research Ramesses II, I would recommend some links below.
About his DNA
https://bigthink.com/surprising-science/were-the-ancient-egyptians-...
https://en.wikipedia.org/wiki/List_of_DNA-tested_mummies
Short Chronology of Ancient Egypt by VV Kubarev (all Pharaohs are listed there)
https://eesa-journal.com/wp-content/uploads/29-56.pdf
Britannica
https://www.britannica.com/biography/Ramses-II-king-of-Egypt
Ancient Egyptian Chronology by Erik Hornung, Rolf Krauss, and David A. Warburton
https://brill.com/view/title/7028
Chronologie des Pharaonischen Ägypten, Mainz am Rhein: Verlag Philipp von Zabern,1997. By Jürgen von Beckerath.
Pharaonic king-lists, annals and day-books : a contribution to the study of the Egyptian sense of history, 1986. By Donald B. Redford.
Quora for insights
https://www.quora.com/Who-are-the-direct-descendants-of-Egyptian-ph...
I hope my answer will be useful.