I wasn't using Angular, but I was able to resolve the getBoundingClientRect returning zeroes issue by setting up a ResizeObserver since I was calling getBoundingClientRect before the element was added to the DOM.