Does bike geometry or wheel affect maximum cog size?
No the frame size doens't limit your cassette choice.  Within reason any 700c wheeled bike should take any available cassette size.
What matters most is the Derailleur's capabilities.   The maximum and minimum tooth count is a published value for each derailleur model.
Also in the stats are other useful values.
Presuming your bike is a 2017, it would have had a &quot;Shimano 105 GS&quot; rear mech.  (from https://99spokes.com/bikes/cannondale/2017/superx-105)
This might be the RD-5800-GS which is documented at https://bike.shimano.com/en-EU/product/component/105-5800/RD-5800-GS.html




Item
Value




Low sprocket_Max.
32T


Low sprocket_Min.
28T


Max. front difference
16T


Top sprocket_Max.
12T


Top sprocket_Min.
11T


Total capacity
37T




So nominally this combination would take a largest cog with 28/30/32 tooth.  The smallest is 11 or 12T, so it wouldn't work well if the little cog was a 14, and probably jamb up on a 16T.
Shimano's specs are notoriously conservative, so this combo probably runs fine on 34T but would be nominally &quot;out of spec&quot;

That said, there might be something special about your bike which the mechanic has noticed, but not come across in the text of your question.  Adding a photo might help.