I'm no expert in 3D, but here's my 2 cents. First of all, I think the orientation of the camera shouldn't matter but the relative position of camera - even if a sprite comes towards you from your left side, it should show a forward sprite, not right sprite. Second thing I'd do is making this problem 2D by leaving y axis out of the equation.
Something like this (untested, sorry if it doesn't work as expected!):
var pos_2d = Vector2(global_transform.origin.x, global_transform.origin.z)
var camera_pos_2d = Vector2(camera.global_transform.origin.x, camera.global_transform.origin.z)
var camera_pos_2d_local = pos_2d - camera_pos_2d
var forward = global_transform.basis.z
var forward_2d = Vector2(forward.x, forward.z)
var angle = forward_2d.angle_to(camera_pos_2d_local)
Use this angle to determine actual sprite. Close to 0 should be forward, around PI backwards.