I want to get a cuboid to work similarly to a raycast by checking if it intersects with objects of a specific layer. I have tried using a boxcast but, to my understanding, it can only cast cubes.
BoxCast can cast any rectangular prism AKA “box” with any dimensions. Have you checked the documentation? Unity - Scripting API: Physics.BoxCast