This is one of the challenges of riding on such a thin (narrow) line (like a plank - or even just the painted line on the side of the road) is so difficult.
The thing is that in order keep a srtraight line on a very narrow path, you need much finer motor control of your arms, a good 'feel' for your bike, some good components, and the ability to remember to be able to look farther in front of the bike, but keep your awareness of where you are steering based on your inputs to the bike, but not looking down.
If you want to be impressed by one of the best in the world at steering difficult scary /r/sweatypalms courses:
https://www.youtube.com/channel/UC9kOkY1nYc0uADWRiRH64Rw
Watch the "do a wheeelie" vid on his YT home -- doing a wheelie on a train-rail, and jumping to the other train-rail without losing your wheelie or momentum - but all his vids are mind blowing.