Does lecturing for your PI count as a "guest lecture" for a CV?
I would limit the term "guest lecture" to cases where you were specifically invited to give a lecture to the course, because of your ability to contribute something special that the regular instructor could not do. (E.g. you have special expertise on a particular topic, or experiences to relate, or notable achievements, etc.) I wouldn't apply it to simply covering a class (teaching routine material) because the professor is away.
However, you would normally have a separate section on your CV describing your teaching experience, which would include an entry showing that you were a TA for this course. Under this entry, you could describe your duties, which could include something like "occasional lecturing".
There are two different parts of the CV that you're confusing. One of them is "Invited Talks" (or a similar phrasing) which is part of the research portion of the CV and is intended to show that people are interested in your research. This would include colloquia, conferences, and seminars at other schools. If you're very early career you can include seminars at your own school, provided they're research talks.
A totally different part of the CV is your teaching experience. If you have very little teaching experience and you're applying for jobs that involve teaching, then it would make sense to include that you have lecturing experience substituting in a particular course. If the rest of your teaching experience is just grading or running recitation sections, showing that you have a little experience lecturing to a larger class can look good.
You are probably correct that Guest Lecturer and Substitute Lecturer aren't the same thing. But both could be listed on the CV as separate items. You want to make your best case there while being honest and informative. Just label it appropriately and, if necessary, provide a phrase of explanation. "I was honored by Prof Dimsdale to cover several lectures on mumble magic theory".
Normally a Guest Lecturer will speak on a topic of his/her own choosing, whereas a substitute will speak on the normal subject matter of the course.