I am not able to reproduce this locally, but the EWS results from https://github.com/WebKit/WebKit/pull/11403 indicate that test is a flaky timeout on the iOS simulator.
<rdar://problem/106755005>
Test history: https://results.webkit.org/?suite=layout-tests&test=fast%2Fmediastream%2FgetUserMedia-to-canvas-2.html
The timeouts might have been resolved by https://commits.webkit.org/263750@main