You are not HMC5883L! So if you use the libraries for the HMC you will get a random (noise) direction. Once you use the QMC libraries the result looks ok. But they are not HMC5883. Look at the markings on the chip.
LAFVIN Super Starter Kit for Arduino R3 Mega2560 Mega328 Nano with Detailed Tutorial - Compatible with Arduino IDE
11 Review
Vilros Raspberry Pi 4 4GB Complete Starter Kit - Black Fan-Cooled Aluminum Case for Heavy-Duty Performance
12 Review
GeeekPi Raspberry Pi Cluster Case with Cooling Fan and Heatsink for Pi 4 Model B, 3 Model B+ & 3/2 Model B
11 Review
REXQualis Comprehensive Starter Kit with Arduino MEGA 2560 & Detailed Tutorial for Arduino IDE Compatibility
11 Review
36-Pack Black Rubber PC CPU/Case Fan Screws/Rivets Set for Computer
11 Review
π₯οΈ Helifouner 450-Piece Computer Standoffs Spacer Screws Kit: Ideal for Hard Drive, Motherboard, Fan, Power Graphics & Computer Cases
10 Review
Glarks 660 Pieces Phillips Assortment Motherboard
10 Review
MacBook Retina 13-inch (A1425, A1502) and π© 15-inch (A1398) Bottom Case Screw Set with Pentalobe Screwdriver
11 Review