So if you are successfully getting your memberID and badge ID back, where in the code is throwing your errors? Where does it think you are using member._id as an object?
I just checked my test site again and I am receiving no console errors using the code I shared above, so I’m not 100% sure what is different about your setup but you can look to see if there is more error information and address each part individually.
Then if following the errors doesn’t work I would break down the code and debug one step at a time. Comment out the code to get the badges and make sure your current member call isn’t getting any errors
Then in the backend, debug the file there by manually placing a member ID and running in the backend to see if that returns as expected