How to save browser errors using Robot Framework and Selenium Library

Hi community,

I need to save the browser console error messages (like the image below) to a file if a test case fails.

During a performance testing running a robot script in parallel (selenium grid + docker + robot framework + pabot), we verified that part of script failed to load the page.
No issue was identified in the Backend, so we need to know what is happening in the front-end

This is the problem. I dont know how at this moment.
Since the test is executed in the docker, we need to get a way to flush the browser trace to a file when a test fails.

Could someone provide ideas or suggestions on how to handle this situation?