Angle between 3 vectors in 3d space

As per the solution(s) in this post Angle between 3 points in 3d space I have a java script function that takes 3 vectors(not just points/coords technically) & calculates the angles between them. The function’s uses its 2nd argument to calculate the angle between the other two(1 & 3). I run the function 3 times with 3 different orders of the input vectors to get 3 angles & it works fine. I’ll show it usage soon. In the program I’m using the function in, the input vecs are just positions on the surface of a sphere that I can position anywhere on it with lat/lon sliders, which I connect by lines(arcs actually) that creates a spherical triangle wherever I position the vecs(as like vertexes of the triangle. Anyway, that was just some background info so its clear. So, even though the faction in Q its a 3D solution, apparently it assumes the vectors are all co-planar, which they are not. It finds the angles of each vertex & the 3 angles obtained always just add up to 180 deg. But on a sphere, it should always be at least 180 & upto just under 540(pretty sure). So, I think I just have to get the function to take into account that the input vectors z components are what is tangent to/always lie flat on the sphere, which they are, as I also use them to position a 2D circle of any radius anywhere on the sphere. Here is the function:

function ang3D2(v1, v2, v3) {
      // Copy and normalize the input vectors
      let V1 = v1.copy().normalize();
      let V2 = v2.copy().normalize();
      let V3 = v3.copy().normalize();
  
      let Va = p5.Vector.sub(v1,v2).normalize();
      let Vb = p5.Vector.sub(v3,v2).normalize();
  
      let dots = p5.Vector.dot(Va,Vb);
  
      //let crosses = p5.Vector.sub(Va,Vb);
      //let crossesMag = crosses.mag();
  
      let angle = (Math.acos(dots) * 180.0) / Math.PI;
  
      //let angle2 = (Math.acos(crossesMag) * 180.0) / Math.PI;
      //let angle3 = (Math.acos(crossesMag) * 180.0) / Math.PI;
      //let angle4 = (Math.atan2(angle3,dots) * 180.0) / Math.PI;
      //let angle5 = (Math.atan2(crossesMag,dots) * 180.0) / Math.PI;
  
      return Math.round(angle * 1000) / 1000;  // just change angle to angle2,3,4,5 etc

    }//ang3d2()  

    //based off of https://gist.github.com/andfaulkner/c4ad12a72d29bcd653eb4b8cca2ae476 

    //& its usage:

    function angs() {
      if (cyl1V && cyl2V && cyl3V) {
        //let angs;
        ang1 = ang3D2(cyl2V, cyl1V, cyl3V);
        ang2 = ang3D2(cyl1V, cyl2V, cyl3V);
        ang3 = ang3D2(cyl1V, cyl3V, cyl2V);
        angS = ang1 + ang2 + ang3;
        console.log(angS);
      } //fi
    } //angs  

So, the function works as it is(almost in the way I need it to) but, in my case the input vecs are NOT coplanar(though it is a 3D solution?!). & I hope its clear as to what I’ve been trying. Using cross product instead of just cos dot etc. Cany anyone PLEASE steer me in the right direction ? For some reason I can’t fund much info about this in particular yet I’m sure its probably on the trivial side, though I’m not a professional programmer by any means. Thanks in advance.