Found a bizarre solution unlike other forum answers, although it really boils down to "turn it off and back on again".
I exported the data source (SharePoint list) to CSV with schema:
This downloaded a CSV file.
I deleted the list from SharePoint, then imported the list back into SharePoint using the CSV.
Went into my app, deleted the old list as a data source, and added the new one. Being that the new list is just a copy of the old one, this caused no problems. Saved the app and went back to power apps menu. I played the app from the menu.
I got a popup asking for permission to access the list. I clicked "Allow". The app worked finally.
I kept the app running in another tab while I opened my SharePoint site and embedded the app into it. This gave me the error again. However, it also gave me another popup on the app running in the other tab. I clicked "Allow" again and the error in the embedded app disappeared and the embedded app began working.
My opinion: when embedding a Power App into SharePoint, the app might need to ask a second time for permission to use the data source. An embedded app in SharePoint isn't capable of giving you that little permission request popup, so you need the app already running elsewhere to get the necessary popup and give permissions. If you don't give permissions the second time, for security reasons it revokes all permissions previously granted.