I would not make this decision based only on whether WGU is online or whether the local university is ranked in the top 100. The more useful question is which path gives you the preparation that a research-focused PhD application will actually need.
WGU is an accredited university, and finishing there could be the fastest route to a bachelor’s degree and a job. The potential weakness for your specific goal is not the legitimacy of the degree. It is that areas like computer architecture, computer vision, and reinforcement learning usually require strong math and theory courses, research experience, and detailed letters from faculty who know your work. Those things can be harder to build in a competency-based online program unless you create them elsewhere.
The local route may be worth the lost credits if it gives you real access to research labs, upper-level math and CS courses, faculty relationships, and a clear engineering transfer pathway. But I would verify all of that before giving up 39 credits. Get a written transfer-credit evaluation, confirm that your community college is an eligible pathway institution, and check the current course and GPA requirements. Completing a pathway does not necessarily guarantee admission.
I would also avoid planning on “multiple master’s degrees.” One research-oriented master’s with a thesis, strong letters, and meaningful research would usually help more than several course-only degrees.
If I were deciding, I would compare two concrete plans: time to graduation, out-of-pocket cost, access to research, required math courses, and who could eventually write strong letters. Good luck!