IIRC, Watt and Watt's "Advanced Animation and Rendering Techniques" (Chapter 3) has an interesting discussion on this (which I think is summarising the work of Clark https://dl.acm.org/doi/10.1145/965103.807440 ... but only the first page seems to be there :-(  )

Failing that, you could try the following: Take the Cubic Bezier cage shown in green with curve in purple:

[![Bezier (Possibly not 100% accurate)][1]][1]

If you do a do a mid-point subdivision of the curve, you can measure the (squared) distance (red) from the centre of the straight line (blue) joining the original end points to the mid point of your curve. If this exceeds a threshold (some number of pixels), recurse, else stop.
 

I seem to recall that the difference between the straight-line approx and the curve drops by a factor of 4 (or was it 8??) with each subdivision, so it converges quite rapidly.

The maths to subdivide the 4 control points of any Cubic Bezier into 2 smaller Beziers is quite simple .. but I'd need to go and look it up ;-)

Though, thinking about it, I'd say you might need to go one more step to account for these cases:
[![enter image description here][2]][2]


  [1]: https://i.sstatic.net/Nxyy4.png
  [2]: https://i.sstatic.net/T5QI5.png