Firstly be aware that function doesn't return the correct data when you are too far from the group member.
Secondly it still works properly in minimap by Fyrakin.
Try to verify what GetGroupUnitTagByIndex outputs because it does weird things sometimes.
EDIT:
Sorry I read too fast, I'm only using the 1st value returned and it works correctly, I don't know for value 2 and 3
GetTargetMountedStateInfo(*string* _characterOrDisplayName_)
** _Returns:_ *[MountedState|#MountedState]* _mountedState_, *bool* _isRidingGroupMount_, *bool* _hasFreePassengerSlot_