This will happen to you, probably in your first month. A test fails on the build server about once in ten runs. On your machine it passes every time. Someone re-runs the build, it goes green, and everyone moves on.
Do not move on. Playwright gives you a very strong tool for this, and most juniors do not know it exists.
Step 1. Turn on traces. A trace is a recording of everything the test did: every action, every network call, and a snapshot of the page at each step.